【问题标题】:How to do a rollback from google-play-services in eclipse?如何在 Eclipse 中从 google-play-services 进行回滚?
【发布时间】:2014-12-27 21:26:47
【问题描述】:

我在使用 6.5.87 版 Google Play 服务时遇到问题,我需要回滚/安装 6.1 版(6.1.71 或 6.1.11)。我怎么做?我在哪里可以得到文件?在 thh Android SDK 中,我看不到任何选项。我使用 Eclipse。

我在 google-play-services_lib 项目中找到了一个文件 version.xml

 <?xml version="1.0" encoding="utf-8"?> 
 <resources>
     <integer name="google_play_services_version">6587000</integer> 
 </resources>

【问题讨论】:

  • 你真的应该只使用 Gradle。您可以在 Eclipse 中使用 Gradle。只需通过 Eclipse 配置设置或通过命令行运行;然而,Android Studio 将为您完成这一切。您可以将项目从 Eclipse 导入 Android Studio 并设置 Google Play Services 版本。整个过程大约需要 10 分钟。
  • @JaredBurrows 之后我可以回到 Eclipse 吗?如果我使用 eclipse 配置/命令行(没有 android studio)——我需要做什么?我从没用过gradle
  • 您也可以发布有关您遇到的问题的问题,我们可以帮助您解决问题...
  • @TamarG 是的。我曾经使用过我们的 Eclipse + Gradle。您可能更容易使用 Android Studio,文件 -> 从 Eclipse 导入项目。它会尝试为您设置 Gradle。

标签: android eclipse google-play-services


【解决方案1】:

你不能只通过改变整数来回滚,你需要指定你实际使用的构建。

如果您正在构建 google play services 项目,您将在清单中使用此行,以便动态生成内部版本号。

<meta-data
    android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />

话虽如此,您仍然需要确保您正在构建的版本比您遇到问题的版本旧。

这是一篇关于如何使用项目进行构建的好文章: http://hmkcode.com/adding-google-play-services-library-to-your-android-app/

但是,如果您要复制以前构建的库,则必须在项目的属性中引用正确的库。请检查您的 Eclipse / Android Studio 设置以确保您已添加旧库。您仍然应该在清单中为整数使用动态值,但如果您坚持使用静态值,您可以在 google-play-services_lib/res/values/version.xml 中找到库的整数值

【讨论】:

【解决方案2】:

最简单的方法可能是通过 SDK 管理器下载最新的“Google 存储库”。将 ${android_sdk}/extras/google/m2repository/ 添加到您的存储库列表中以从中提取依赖项(请参阅“声明存储库”in this)。然后将您的旧版本号放回您的 Maven 依赖项声明中。 (如果您通过 Maven/Ant declarations 拉取 Google Play 服务依赖项,就会出现这种情况。)

显然你也可以将 aar 文件从 m2repository 目录中复制出来,但是你必须手动管理依赖关系并处理类未找到异常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-05-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-21
    • 1970-01-01
    • 1970-01-01
    • 2016-09-25
    相关资源
    最近更新 更多