缺少gms.maps.GoogleMap,因为重复类中存在潜在的多重问题

时间:2015-10-08 17:10:06

标签: java android gradle compiler-errors multidex

我正在为我的项目添加GoogleMap视图。

从我的研究中我需要补充:

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

到我的构建依赖项(没有它我无法导入import com.google.android.gms.maps.OnMapReadyCallback)。

因此,当我添加该依赖项时,一切都在类中,我可以导入并使用它。

然后我去编译,我得到了一个令人讨厌的错误:

  

错误:任务执行失败   完成非零退出值2

经过研究,我确定这意味着我现在超过65k方法限制。

快速前进,我为我的应用添加了多语言支持。现在我遇到了一个新错误,无法找到解决方案。

  

任务执行失败':packageAllDebugClassesForMultiDex'。

     
    

java.util.zip.ZipException:重复条目:com / google / android / gms / common / SignInButton.class

  

显然,有两个同名的班级发生冲突。但我不明白这是怎么可能的。这是我的编译依赖项。我没有看到任何重复的导入或潜在的碰撞。你能告诉我在哪里寻找可能造成这次碰撞的地方吗?

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile 'com.android.support:support-v4:22.0.0'
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.google.android.gms:play-services-maps:8.1.0'
    compile 'com.android.support:multidex:1.0.1'
    compile project(':CordovaLib')
    compile project(':app-FacebookLib')
    compile files('libs/universal-image-loader-1.9.3.jar')
    compile files('libs/twitter4j-core-4.0.4-SNAPSHOT.jar')
}

1 个答案:

答案 0 :(得分:0)

我的项目中的库文件夹中添加了一个google-play-services.jar文件,该文件与此文件发生冲突。去掉那个修好它的罐子。

我从这个答案找到了副本

https://stackoverflow.com/a/28937822/3324388