I setup my app with 'react-native-firebase' to receive the notifications. The problem now is that I have to find a way to show the notifications
I installed react-native-push-notifications and now I cant build the prpject anymore. I get the error at 96%
" UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define"
It seems to be a conflict with the two libraries. How can i fix it?
That first error can be solved by adding:
android {
defaultConfig {
multiDexEnabled true
}
}
But then you get a second one, which is the following one:
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'.
> com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/iid/zzb$zza;
Still no clue on how to solve it.
UPDATE: Found it in another answer.
Make sure to update all of these (if you have one or any) to the latest by adding a + like so:
compile 'com.google.android.gms:play-services-gcm:+'
compile 'com.google.android.gms:play-services-analytics:+'
compile 'com.google.android.gms:play-services-location:+'
For anybody looking for an answer.
I solved this problem by replacing:
compile ('com.google.android.gms:play-services-gcm:8.1.0') {
force = true;
}
with:
compile ('com.google.android.gms:play-services-gcm:11.8.0') {
force = true;
}
in android/app/build.gradle.
I solved the same issue by changing the line in the dependencies section of android/app/build.gradle from
compile project(':react-native-push-notification')
to
compile(project(':react-native-push-notification')) {
exclude group: "com.google.android.gms"
}
mimicking what was done in this post.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.
Most helpful comment
I solved the same issue by changing the line in the
dependenciessection ofandroid/app/build.gradlefromcompile project(':react-native-push-notification')to
mimicking what was done in this post.