2015-08-20 85 views
0

我在構建一個使用2個插件和google-maps plugin的科爾多瓦應用程序。科爾多瓦庫版本之間的Android衝突

事實是,谷歌地圖插件需要

  • com.google.android.gms:play-services-maps:7.8.0
  • com.google.android.gms:play-services-location:7.8.0

而推插件需要com.google.android.gms:play-services:6.1.11所以當我嘗試構建應用程序,gradle這個抱怨:

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

這裏是gradle dependencies輸出:

compile - Classpath for compiling the main sources. 
+--- com.android.support:appcompat-v7:22.+ -> 22.2.1 
| \--- com.android.support:support-v4:22.2.1 
|   \--- com.android.support:support-annotations:22.2.1 
+--- org.jboss.aerogear:aerogear-android-core:2.1.0 
+--- org.jboss.aerogear:aerogear-android-pipe:2.1.0 
| +--- org.jboss.aerogear:aerogear-android-core:2.1.0 
| \--- com.google.code.gson:gson:2.2.2 
+--- org.jboss.aerogear:aerogear-android-push:2.2.0 
| +--- org.jboss.aerogear:aerogear-android-core:2.1.0 
| +--- org.jboss.aerogear:aerogear-android-pipe:2.1.0 (*) 
| +--- com.google.android.gms:play-services:6.1.11 
| \--- com.google.code.gson:gson:2.2.2 
+--- com.google.android.gms:play-services-maps:7.8.0 
| \--- com.google.android.gms:play-services-base:7.8.0 
|   \--- com.android.support:support-v4:22.2.0 -> 22.2.1 (*) 
\--- com.google.android.gms:play-services-location:7.8.0 
    +--- com.google.android.gms:play-services-base:7.8.0 (*) 
    \--- com.google.android.gms:play-services-maps:7.8.0 (*) 

build.gradle提取:

apply from: "org.jboss.aerogear.cordova.push/hellocordova-dependencies.gradle" 
dependencies { 
    compile fileTree(dir: 'libs', include: '*.jar') 
    // SUB-PROJECT DEPENDENCIES START 
    debugCompile project(path: "CordovaLib", configuration: "debug") 
    releaseCompile project(path: "CordovaLib", configuration: "release") 
    compile ("com.google.android.gms:play-services-maps:7.8.0") 
    compile ("com.google.android.gms:play-services-location:7.8.0") 
    // SUB-PROJECT DEPENDENCIES END 
} 

我不知道我怎麼能解決這個版本衝突...任何想法?

回答

0

所以,我終於得到了它,我剛剛創建的build-extras.gradle並告訴gradle這個給力7.8.0版本:

configurations.all{ 
    resolutionStrategy{ 
     force ("com.google.android.gms:play-services:7.3.0") 
    } 
}