Reputation: 21564
I'm building a cordova app that uses 2 plugins aerogear push plugin and google-maps plugin.
The fact is that the google maps plugin requires
com.google.android.gms:play-services-maps:7.8.0
com.google.android.gms:play-services-location:7.8.0
whereas the push plugin requires com.google.android.gms:play-services:6.1.11
so when I try to build the app, gradle complains :
Error: more than one library with package name 'com.google.android.gms'
here is the output of 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 (*)
extracted from 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
}
I don't know how I could handle this version conflict... Any idea ?
Upvotes: 0
Views: 883
Reputation: 21564
So I finally got it, I just created the build-extras.gradle
and tells gradle to force 7.8.0 version:
configurations.all{
resolutionStrategy{
force ("com.google.android.gms:play-services:7.8.0")
}
}
Upvotes: 3