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...

The hybrid cloud implies using both public and private clouds to reach the company’s goals in the most effective way. This type is usually adopted by companies that need a private cloud to work with sensitive data (e.g., financial institutions) or follow regulation requirements (e.g., GDPR) but still want to benefit from public cloud solutions. Such hybrid solutions are usually complex and require some advanced knowledge in adoption and maintenance, which also comes at more costs than going with the public cloud>> google cloud migration consultant

JacobHarman said...

Mobilunity is a main supplier of information lake designing administrations in Ukraine. The organization has a group of experienced information designers and draftsmen who have some expertise in executing and overseeing information lake arrangements utilizing many innovations. For its clients Mobilunity offers two potential models of participation for information lake designing administrations. You can pick committed groups of AWS Specialists. This one suits better for huge activities. Mobilunity can give a devoted group of AWS specialists who will work solely on your undertaking. This group will be made out of profoundly gifted experts who have broad involvement with AWS information lake execution. The group will work intimately with your interior group to guarantee consistent correspondence and joint effort all through the venture>> enterprise data lake services