android - 如何解决Android Studio中的依赖项中有2个具有相同包名的库?

标签 android google-maps android-studio

我的项目中有以下依赖项:

     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'

我该怎么办?

最佳答案

我尝试了以下方法并且成功了:

enter image description here

所以问题不在于

编译('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/

相关文章:

javascript - 在一页上加载多个 Google map - 慢?

android - 有人成功地将 live555 移植到 android 吗?

android - 将微调器设置为未选中

java - 错误 :no resource identifier found for attribute"showAsAction"in package android

android - 如何在 Android Studio 中使用 Google Endpoints 写入 Cloud SQL

android - 为什么 jackOptions 在 Android Studio 2.2 Preview 1 中不起作用?

intellij-idea - Intellij 文本不可见

android - 映射外部字符串android

java - android 类 fragment 膨胀时出错

google-maps - 如何在谷歌地图中创建一个带有气泡聊天背景的自定义标记,以及像调情 map 这样的图像右上角的数字?