gpt4 book ai didi

java - AndroidHttp 类型中的方法 newCompatibleTransport() 引用了缺失的类型

转载 作者:行者123 更新时间:2023-11-30 09:08:28 25 4
gpt4 key购买 nike

GoogleAccountCredential credential = GoogleAccountCredential
.usingOAuth2(MainActivity.this,
Arrays.asList(DriveScopes.DRIVE_FILE));
credential.setSelectedAccountName(driveAccountName);
//Errors on below line
HttpTransport ht = AndroidHttp.newCompatibleTransport();
Drive service = new Drive.Builder(ht, new GsonFactory(), credential).build();

1. HttpTransport cannot be resolved to a type

2. The method newCompatibleTransport() from the type AndroidHttp refers to the missing type HttpTransport

我在 libs 文件夹中添加了以下 jar 文件:

  1. google-api-client-android-1.18.0-rc.jar
  2. google-api-services-drive-v2-rev1-1.7.2-beta.jar
  3. google-http-client-android-1.18.0-rc.jar
  4. google-http-client-gson-1.18.0-rc.jar

最佳答案

必须使用:

google-http-client-1.18.0-rc.jar

关于java - AndroidHttp 类型中的方法 newCompatibleTransport() 引用了缺失的类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23509717/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com