2017-02-18 42 views
0

我厭倦了這個錯誤的很多事情,但我無法修復它。如何修復包名爲'com.google.android.gms'的多個庫?

Error:Execution failed for task ':app:processDebugResources'. 

Error: more than one library with package name 'com.google.android.gms'

的build.gradle:

apply plugin: 'android-library' 

dependencies { 
    compile fileTree(dir: 'libs', include: '*.jar') 
    compile project(':google-play-services_lib') 
} 

android { 
    compileSdkVersion 10 
    buildToolsVersion "25.0.2" 

    sourceSets { 
     main { 
      manifest.srcFile 'AndroidManifest.xml' 
      java.srcDirs = ['src'] 
      resources.srcDirs = ['src'] 
      aidl.srcDirs = ['src'] 
      renderscript.srcDirs = ['src'] 
      res.srcDirs = ['res'] 
      assets.srcDirs = ['assets'] 
     } 

     // Move the tests to tests/java, tests/res, etc... 
     instrumentTest.setRoot('tests') 

     // Move the build types to build-types/<type> 
     // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ... 
     // This moves them out of them default location under src/<type>/... which would 
     // conflict with src/ being used by the main source set. 
     // Adding new build types or product flavors should be accompanied 
     // by a similar customization. 
     debug.setRoot('build-types/debug') 
     release.setRoot('build-types/release') 
    } 
} 

非常感謝。

回答

0

您正在編寫google play service library,但在您的gradle文件中,有一些庫依賴於此lib。因此,如果您錯誤地使用以上包含的程序庫。首先,你檢查你的libs目錄,其中包含google play service library,如果你不需要編譯compile project(':google-play-services_lib')。我認爲您可以按照https://developers.google.com/android/guides/setup來設置Google Play服務的最佳方式。

相關問題