NetHttpTransport无法解析为Google api实现的类型

问题描述 投票:0回答:1

我正在浏览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

java google-sheets google-sheets-api google-api-java-client
1个回答
0
投票

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

import com.google.api.client.http.javanet.NetHttpTransport;

© www.soinside.com 2019 - 2024. All rights reserved.