DexException
rpavlovs opened this issue · 4 comments
Problem:
Getting dependency issues with other libraries that use google mobile services:
com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzas;
Solution:
Change react-native-idfa/android/build.gradle
to pull in latest version of play-services-ads
Rather than to enforce a particular version which might be conflicting to others my suggestion is to use overriding in your app/build.gradle
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.getRequested().getGroup() == 'com.google.android.gms') {
// If different projects require different versions of
// Google Play Services it causes a crash on run.
// Fix by overriding version for all projects.
details.useVersion('9.8.0')
}
}
I’ve seen that approach, but thought latest would be a better default. That’s what all other packages that I use seems to do.
Is version 9.8.0
significant is some way?
I don’t mind increasing it since I use a strategy resolver for handling it my self. But there might be other libraries affecting your gms dependencies if you do not pin it.
Thank you! Will keep that in mind