我正在浏览Google表格的Google Java快速入门页面,但在完成这些步骤并尝试运行提供的示例代码后,出现以下错误:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
NetHttpTransport cannot be resolved to a type
GoogleNetHttpTransport cannot be resolved
Sheets cannot be resolved to a type
Builder cannot be resolved to a type
Sheets cannot be resolved to a type
JsonFactory cannot be resolved to a type
The method getValues() is undefined for the type ValueRange
at SheetsQuickstart.main(SheetsQuickstart.java:66)
关于可能导致它的原因的任何想法?
这是我关注的快速入门表:https://developers.google.com/sheets/api/quickstart/java
检查您的进口。您需要导入此程序包以解决此错误并检查依赖性。
import com.google.api.client.http.javanet.NetHttpTransport;