Thursday, September 24, 2015

Cordova / Ionic - Multiple Dex Issue with "Facebook Connect" and "LocalNotification" plugins.

Had a problem with Cordova / Ionic today:

com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
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)

After some hours of reading and testing found solution that worked for me in following configuration:

com.phonegap.plugins.facebookconnect 0.11.0 "Facebook Connect"
de.appplant.cordova.plugin.local-notification 0.8.2-dev "LocalNotification"

Fix was quite simple (after a couple of hours :) :

plugins/com.phonegap.plugins.facebookconnect/plugin.xml:

-   <framework custom="true" src="platforms/android/FacebookLib">
+   <framework src="com.android.support:support-v4:+">
+   <framework src="com.facebook.android:facebook-android-sdk:3.23.0">

plugins/de.appplant.cordova.plugin.local-notification/plugin.xml:

-   <dependency id="cordova-plugin-android-support-v4">
+   <framework src="com.android.support:support-v4:+">


PS: de.appplant.cordova.plugin.local-notification will install cordova-plugin-android-support-v4 - you can remove it after this with ionic plugin remove cordova-plugin-android-support-v4

7 comments:

sriram said...


Hats off to your presence of mind..I really enjoyed reading your blog. I really appreciate your information which you shared with us.
ionic training in chennai

Aruna Ram said...

Surpassing Article, This post contains great information about this topic. Can you please do a more extra post like from this blog and Thank you much more for sharing this useful info.

Primavera Training in Chennai
Primavera Coaching in Chennai
Corporate Training in Chennai
Pega Training in Chennai
Embedded System Course Chennai
Linux Training in Chennai
Job Openings in Chennai
Social Media Marketing Courses in Chennai
Soft Skills Training in Chennai
JMeter Training in Chennai
Primavera Training in Anna Nagar

Faizal said...

Thanks for Providing all kind of information's Here...This Helps to learn something Different like Technically and Non Technically...Keep Doing
Java training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery

priya said...


The well-known Business Process Management (BPM) tool PEGA was developed using Java ideas and enables users to modify more quickly than Java-based apps. PEGA is used primarily to cut expenses and advance commercial objectives. PEGA was developed using OOP and Java concepts. To learn more about Pega, join Pega Training In Chennai at FITA Academy.

Pega Training In Chennai

priya said...


Corporate training is the process of educating employees using a variety of learning programmes through a system of activities. It serves as a catalyst for employee achievement, which in turn signifies your company's or organisation's overall success. According to a LinkedIn survey, 94% of employees said they would remain at a firm if it invested in their learning requirements because training is seen as a crucial aspect of their professional lives. To know more about corporate training features, join Corporate Training Companies In Chennai at FITA Academy.

Corporate Training Companies In Chennai

Jack Dowson said...
This comment has been removed by the author.
JacobHarman said...
This comment has been removed by the author.