First of all, thank you for this plugin!
I've installed 2.1.1 plugin version. In componentDidMount I configure plugin. Application crashed after launch. Commenting configure method prevented from crashing.
Then I've updated Google Play Services and Build Tools to latest. Build failed with this:
:app:dexDebug
Unknown source file : UNEXPECTED TOP-LEVEL EXCEPTION:
Unknown source file : com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/iid/MessengerCompat$1;
Unknown source file : at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
Unknown source file : at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
Unknown source file : at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
Unknown source file : at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
Unknown source file : at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
Unknown source file : at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
Unknown source file : at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
Unknown source file : at com.android.dx.command.dexer.Main.run(Main.java:277)
Unknown source file : at com.android.dx.command.dexer.Main.main(Main.java:245)
Unknown source file : at com.android.dx.command.Main.main(Main.java:106)
PushNotification.configure({
onRegister: function(token) {
console.log( 'TOKEN:', token );
},
onNotification: function(notification) {
console.log( 'NOTIFICATION:', notification );
},)
senderID: "MY_ID",
requestPermissions: true,
});
"react-native-auto-updater": "^0.2.5",
"react-native-background-timer": "^0.1.2",
"react-native-idle-timer": "^2.1.0",
"react-native-linear-gradient": "^1.5.12",
"react-native-material-switch": "git+https://github.com/recr0ns/react-native-material-switch.git",
"react-native-mauron85-background-geolocation": "git+https://github.com/mauron85/react-native-background-geolocation.git#issue10",
"react-native-push-notification": "^2.1.1",
"react-native-side-menu": "^0.19.0",
"react-native-webview-bridge": "git+https://github.com/alinz/react-native-webview-bridge.git",
I assume that problem caused by Google Play Services, but don't know what exactly it is.
Fixed
compile ('com.google.android.gms:play-services-gcm:9.4.0') {
force = true;
}
tnx ! how do i check which version i have ? just changed to this and it worked
For me, I just had to upgrade gradle. Maybe a newer version of gradle handles these conflicts better.
Most helpful comment
Fixed
compile ('com.google.android.gms:play-services-gcm:9.4.0') {
force = true;
}