我的项目中有以下依赖项:
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.2'
compile 'com.google.android.gms:play-services:6.5.87'
compile project(path: ':backend', configuration: 'android-endpoints')
compile project(':library')
compile files('libs/volley.jar')
compile('com.google.maps.android:android-maps-utils:0.3+')
现在在同步时我收到以下错误:
错误:任务“:app:processDebugResources”执行失败。
Error: more than one library with package name 'com.google.maps.android' You can temporarily disable this error with android.enforceUniquePackageName=false However, this is temporary and will be enforced in 1.0
我尝试过如下,但遇到了同样的错误:
compile('com.google.maps.android:android-maps-utils:0.3') {
exclude group: 'com.google.android.gms'
}
我也尝试过如下,但错误仍然存在:
compile('com.google.maps.android:android-maps-utils:0.3') { transitive = false }
我正在使用以下内容:
classpath 'com.android.tools.build:gradle:1.0.0'
我该怎么办?
最佳答案
我尝试了以下方法并且成功了:
所以问题不在于
编译('com.google.maps.android:android-maps-utils:0.3+')
它在以下几行中重复:
compile project(path: ':backend', configuration: 'android-endpoints')
compile project(':library')
请检查它们是否包含名为 com.google.maps.android
的软件包。
关于android - 如何解决Android Studio中的依赖项中有2个具有相同包名的库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29949276/