fechanique / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
624 stars 998 forks source link

Error Multiple dex files on build #86

Open hamzahppa opened 8 years ago

hamzahppa commented 8 years ago

Hello, I get this error when I build my ionic project. Searching for some solutin but still cant find one. It says

UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/actions/ReserveIntents; at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:591) at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:546) at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:528) at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:164) at com.android.dx.merge.DexMerger.merge(DexMerger.java:188) at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334) at com.android.dx.command.dexer.Main.run(Main.java:277) at com.android.dx.command.dexer.Main.main(Main.java:245) at com.android.dx.command.Main.main(Main.java:106)

FAILURE: Build failed with an exception.

What went wrong: Execution failed for task ':transformClassesWithDexForDebug'. com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 2

I install some plugin on my project

cordova-plugin-compat 1.0.0 "Compat" cordova-plugin-console 1.0.3 "Console" cordova-plugin-device 1.1.2 "Device" cordova-plugin-fcm 1.1.4 "FCMPlugin" cordova-plugin-geolocation 2.2.0 "Geolocation" cordova-plugin-google-analytics 0.7.1 "Google Universal Analytics Plugin" cordova-plugin-googleplayservices 19.0.3 "Google Play Services for Android" cordova-plugin-inappbrowser 1.4.0 "InAppBrowser" cordova-plugin-splashscreen 3.2.2 "Splashscreen" cordova-plugin-statusbar 2.1.3 "StatusBar" cordova-plugin-whitelist 1.2.2 "Whitelist" cordova-plugin-x-socialsharing 5.1.1 "SocialSharing" cordova-plugin-x-toast 2.5.2 "Toast" ionic-plugin-keyboard 2.2.1 "Keyboard"

Need some help, please

viky293 commented 7 years ago

I too get this error after updating the plugin.

subhomoy92 commented 7 years ago

I'm also facing the same problem The error that i'm getting is `Error: cmd: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.

Can anybody please help

hamzahppa commented 7 years ago

@viky293 @subhomoy92 did you add another plugin? I am facing this issue because I use cordova google analytics with this plugin. After I remove cordova google analytics, this plugin just work fine even I cant track my apps use

subhomoy92 commented 7 years ago

yes @hamzahppa i have these plugins cordova-music-player-controls cordova-plugin-device cordova-plugin-admobpro cordova-plugin-splashcreen cordova-plugin-network-information cordova-plugin-statusbar

and 2 others i cant remember right now.

It was working good before i add the FCM plugin. If i remove the FCM plugin, it works fine.

Thank you. Any help will be appreciated.