【问题标题】:package com.google.api.client.http.apache doesn't exist when importing project from Eclipse ADT to Android Studio将项目从 Eclipse ADT 导入 Android Studio 时,包 com.google.api.client.http.apache 不存在
【发布时间】:2014-10-25 07:02:32
【问题描述】:

我正在将项目从 Eclipse ADT 迁移到 Android Studio。在我运行该项目之前进展顺利。

我收到了几个包不存在错误:

Error:(34, 41) error: package com.google.api.client.http.apache does not exist
Error:(81, 19) error: cannot find symbol variable transport
Error:(81, 36) error: cannot find symbol class ApacheHttpTransport
Error:(170, 27) error: cannot find symbol variable transport
Error:(170, 44) error: cannot find symbol class ApacheHttpTransport

这些包与 Google 的 API 客户端库有关。我通过扫描Maven Repository page手动添加了依赖项:

compile 'com.google.api.client:google-api-client-auth-oauth:1.2.3-alpha'
compile 'com.google.api.client:google-api-client-http:1.2.3-alpha'
compile 'com.google.api.client:google-api-client-apache:1.2.3-alpha'

但是,我似乎无法为 com.google.api.client.http.apache 找到正确的依赖项。有人愿意分享添加此依赖项的正确方法吗?

【问题讨论】:

    标签: android android-studio packages android-gradle-plugin google-api-java-client


    【解决方案1】:

    使用当前的 Android Studio 和/或 Gradle

    implementation 'com.google.api-client:google-api-client:1.28.0'
    implementation 'com.google.http-client:google-http-client-gson:1.28.0'
    

    来源:https://github.com/googleapis/google-api-java-client

    【讨论】:

      猜你喜欢
      • 2016-08-06
      • 1970-01-01
      • 2013-06-30
      • 2017-10-31
      • 2023-03-03
      • 2017-08-13
      • 1970-01-01
      • 2016-09-07
      • 2015-06-21
      相关资源
      最近更新 更多