相关疑难解决方法(0)

Gradle:错误:包含名称为"com.google.android.gms"的多个库

这个错误信息是什么意思?我的项目中没有重复的包

错误:任务':SimpleReader:processDebugResources'的执行失败.
错误:包含名称为"com.google.android.gms"的多个库
您可以使用android.enforceUniquePackageName = false临时禁用此错误但是,这是临时的,将在1.0中强制执行

build.gradle看起来像这样:

buildscript {

    repositories {
        maven { url 'http://repo1.maven.org/maven2' }
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.9.1'
    }
}
apply plugin: 'android'
android {
    buildToolsVersion '19.0.3'
    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 17

    }
    compileSdkVersion 17
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
    buildTypes {
    }
}
dependencies {
    compile 'com.android.support:support-v4:19.0.1'
    compile 'com.google.android.gms:play-services:4.2.42'
    compile files('libs/gson-2.2.4.jar')
    compile files('libs/httpmime-4.1.jar')
    compile files('libs/httpclient-4.1.1.jar')
    compile files('libs/jsoup-1.7.3.jar')
    compile project(':libraries:actionbarsherlock')
    compile project(':libraries:sherlocknavigationdrawer')
    compile project(':libraries:googleplayservices')
    compile …
Run Code Online (Sandbox Code Playgroud)

android gradle build.gradle android-gradle-plugin

33
推荐指数
3
解决办法
5万
查看次数

播放服务粒度依赖性错误

我尝试使用新的Granular Dependency for Google Play Service 6.5.+

在我的gradle我设置:

dependencies {
    compile 'com.android.support:appcompat-v7:21.0.2'
    compile 'com.google.maps.android:android-maps-utils:0.3'
    compile 'com.google.android.gms:play-services-base:6.5.87'
    compile 'com.google.android.gms:play-services-location:6.5.87'
    compile 'com.google.android.gms:play-services-maps:6.5.87'
}
Run Code Online (Sandbox Code Playgroud)

但是我收回了这个错误:

Error:Execution failed for task ':app:processDebugResources'.
Error: more than one library with package name 'com.google.android.gms'
You can temporarily disable this error with android.enforceUniquePackageName=false
However, this is temporary and will be enforced in 1.0
Run Code Online (Sandbox Code Playgroud)

我已经更新了所有SDK.

使用这个新功能的正确方法是什么?谢谢.

解决了

问题是android-maps-utils已经有Play Service 6.5.+,所以错误.

android google-play-services android-gradle-plugin

9
推荐指数
2
解决办法
3711
查看次数