【问题标题】:Android, one library with old google play service conflicts with google mapsAndroid,一个有旧谷歌播放服务的图书馆与谷歌地图冲突
【发布时间】:2015-12-18 08:43:47
【问题描述】:

我正在为我的项目使用 asne google plus 库。它使用旧版本的 google play 服务。

当我使用较新版本添加 Google 地图时,gradle build 失败并显示以下消息:

Error:Execution failed for task ':app:processDebugResources'.
Error: more than one library with package name 'com.google.android.gms'

我的 app.gradle 中的依赖项:

compile 'com.github.asne:asne-googleplus:0.3.3'

compile 'com.google.android.gms:play-services-maps:8.3.0'
compile 'com.google.android.gms:play-services-location:8.3.0'

当我像这样制作asne 时:

compile ('com.github.asne:asne-googleplus:0.3.3') {
  transitive = true
}

这个库变得不可见,我不能调用它的方法。

如何解决这个冲突?

【问题讨论】:

  • 你不能让两个不同版本的库在一个项目中工作。尝试更新包含旧库的播放服务库。

标签: android google-maps google-play-services


【解决方案1】:

我建议你使用整个依赖

compile 'com.google.android.gms:play-services:8.3.0'

不要将其拆分为 play-services-location:8.3.0 和 play-services-maps:8.3.0 等部分。这个link 详细解释了原因。

【讨论】:

    【解决方案2】:

    您可以尝试仅排除库的 google 依赖项:

    compile ('com.github.asne:asne-googleplus:0.3.3') {
      exclude group: 'com.google.android.gms'
    }
    

    【讨论】:

    • OK gradle 已编译,但是当我尝试调用 asne 方法时,它会抛出异常:java.lang.NoClassDefFoundError: com.github.gorbin.asne.googleplus.GooglePlusSocialNetwork
    猜你喜欢
    • 2015-03-27
    • 2018-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-05
    • 2013-08-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多