【问题标题】:Found 2 versions of google-play-services.jar in the dependency list在依赖列表中找到 2 个版本的 google-play-services.jar
【发布时间】:2014-03-02 10:50:45
【问题描述】:

我知道有几个线程在处理同一个问题,但没有一个解决方案适合我。

我正在构建一个同时使用 Google 和 Facebook SDK 的应用程序。启动 Eclipse 时,我收到以下错误消息:

[2014-03-02 11:40:40 - ***] Found 2 versions of google-play-services.jar in the dependency list,

[2014-03-02 11:40:40 - ***] but not all the versions are identical (check is based on SHA-1 only at this time).

[2014-03-02 11:40:40 - ***] All versions of the libraries must be the same at this time.

[2014-03-02 11:40:40 - ***] Versions found are:

[2014-03-02 11:40:40 - ***] Path: /Users/***/Development/adt-bundle-mac-x86_64-20131030/sdk/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar

[2014-03-02 11:40:40 - ***]     Length: 1501528

[2014-03-02 11:40:40 - ***]     SHA-1: e5f81129dfb3d02df80126512bc98278ed2bb40a

[2014-03-02 11:40:40 - ***] Path: /Users/***/Development/my-app/libs/google-play-services.jar

[2014-03-02 11:40:40 - ***]     Length: 103227

[2014-03-02 11:40:40 - ***]     SHA-1: 70356edea26cc0bec4870d2cbd0eec6f0d2ffcae

[2014-03-02 11:40:40 - ***] Jar mismatch! Fix your dependencies

我对所有三个项目(Facebook SDK、Google SDK、My-App 项目)都尝试了 Android 工具 --->“添加支持库...”,但错误仍然存​​在。很多答案告诉人们删除一个罐子或复制/粘贴罐子......但我对此很陌生,我不想破坏任何东西。

去这里最好的方式是什么?

【问题讨论】:

  • 尝试在所有依赖项目中添加相同版本的支持库jar文件。
  • 您是否导入了一个项目并将google-play-services.jar 添加到其中?如果是,那么删除旧的google-play-services.jar 并使用您的 SHA 创建一个 API 密钥并将其放在清单文件中
  • 我确实这样做了。但是,在导入项目后,我使用我的 SHA 创建了一个 API 密钥并将其放入清单文件中。我还应该收到同样的错误消息吗?
  • 只需从项目 lib 文件夹中删除 google-play-service lib 并清理一次。

标签: android eclipse shared-libraries dependency-properties


【解决方案1】:

当项目中使用同一个jar文件的多个版本时会出现上述问题(包括库项目,如果添加)。最佳做法是删除以前的jar文件并在所有项目中添加一个新更新的相同jar文件相应的项目。

参考这篇文章, https://stackoverflow.com/a/12045627/1665507

【讨论】:

  • @strawberrywine:是的,删除这 3 个并在每个中添加更新的相同 jar 文件。
  • 刚刚注意到我无法为 Facebook 和 Google SDK 删除它们。 bit.ly/1ogFBAb
猜你喜欢
  • 2012-08-16
  • 1970-01-01
  • 2015-02-17
  • 2018-12-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-12-25
相关资源
最近更新 更多