【问题标题】:NetHttpTransport cannot be resolved to a type Google api implementationNetHttpTransport 无法解析为 Google api 实现类型
【发布时间】:2020-04-07 23:12:47
【问题描述】:

我正在浏览 Google 的 Java 快速入门页面以获取 google 表格,但在完成这些步骤并尝试运行提供的示例代码后,我收到以下错误:

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

【问题讨论】:

  • 能否提供您放置依赖项的文件?可能您以错误的方式使用它们

标签: java google-sheets google-sheets-api google-api-java-client


【解决方案1】:

检查您的进口。您需要导入此包以解决此错误并检查依赖项。

导入 com.google.api.client.http.javanet.NetHttpTransport;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-02-11
    • 1970-01-01
    • 2015-10-22
    • 1970-01-01
    • 2012-04-02
    • 2012-01-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多