Reputation: 105
Here I want to use two libraries in my gradle files which are not from same package but it doesnt allow me to use it, how can I solve it?
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:recyclerview-v7:22.2.+'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.google.android.gms:play-services-ads:7.5.0'
compile 'com.android.support:design:22.2.1'
compile files('libs/fortumo-in-app-android-sdk.jar')
compile 'com.google.firebase:firebase-messaging:9.4.0'
Upvotes: 0
Views: 201
Reputation: 19427
I guess you're getting an error, something like this:
All com.google.android.gms libraries must use the exact same version specification (mixing versions can lead to runtime crashes)
Which is quite self-explanatory.
Change the following:
compile 'com.google.android.gms:play-services-ads:7.5.0'
To this:
compile 'com.google.android.gms:play-services-ads:9.4.0'
Upvotes: 1
Reputation: 75788
Problem
Conflicting between two same type com.google
library .
compile 'com.google.android.gms:play-services-ads:7.5.0'
compile 'com.google.firebase:firebase-messaging:9.4.0'
Call firebase-messaging:9.4.0
instead of play-services-ads:7.5.0
Then Clean-Rebuild-Gradle .Before starting work please read Add Firebase to Your Android Project
Upvotes: 2
Reputation: 134
Android force you to use the same google version of dependencies if you are using more then one google dependencies. So i'll suggest you to use the latest dependencies.
compile 'com.google.android.gms:play-services-ads:7.5.0'
Replace above dependency with the below one and you are good to go.
com.google.android.gms:play-services-ads:9.4.0
Upvotes: 2