我想在同一项目中使用Guava和GooglePlayServices。通过gradle添加Guava后,出现了dex构建错误。我能够将冲突的罪魁祸首隔离为GooglePlayServices。我可以使用其中一个,也可以不使用两者。
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:7.5.0'
compile group: 'com.google.guava', name: 'guava', version: '18.0'}
还有其他人遇到吗?解决方案表示赞赏。
最佳答案
我认为您遇到了65k方法限制问题。
最简单的解决方法是只包含所需的内容,而不是包含整个Google Play服务库。
参见https://developers.google.com/android/guides/setup#split
有关65k问题的更多信息:
看到
https://www.contentful.com/blog/2014/10/30/android-and-the-dex-64k-methods-limit/
关于java - Guava vs Google Play服务:构建冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32094754/