1
votes

i have a project that uses Google Map API v2, and now i want to add GCM to this project, when i add GCM dependency to my gradle file i face with this error:

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

my dependencies are:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.github.rey5137:material:1.2.1'
compile ('com.google.android.gms:play-services:4.1.32')
compile 'com.google.android.gms:play-services-gcm:7.8.0'
compile 'com.jpardogo.materialtabstrip:library:1.1.0'
compile('com.balysv.materialmenu:material-menu:1.5.4') {
    exclude group: 'com.nineoldandroids', module: 'library'
}
compile 'com.android.support:support-v4:22.2.0'
compile 'com.android.support:appcompat-v7:21.0.3'

}

what can i do?

1
you should use latest version of com.google.android.gms:play-services..remove the one from compile - Meenal
i don't want force users to update their google play service @MeenalSharma - Sajad Garshasbi
add gcm.jar file and update your build.gradle with this--> compile files('libs/gcm.jar') - Chaudhary Amar

1 Answers

1
votes
compile ('com.google.android.gms:play-services:4.1.32')
compile 'com.google.android.gms:play-services-gcm:7.8.0'

Please DO NOT use two different version of Google Play Service.

Also, most importantly try using those gradle dependencies which required by your application instead of all dependencies. Check here