EddyVerbruggen / cordova-plugin-googleplus

:heavy_plus_sign: Cordova plugin to login with Google Sign-In on iOS and Android
567 stars 628 forks source link

Conflict with phonegap-facebook-plugin (DexException: Multiple dex files) #215

Open rockpriest opened 8 years ago

rockpriest commented 8 years ago

Hi,

I had a problem that I installed phonegap-facebook-plugin before the cordova-plugin-googleplus. Unfortunately the build failed. The error showed the following:

com.android.dex.DexException: Multiple dex files define Landroid/support/annotat ion/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) FAILED

BUILD FAILED

Total time: 1 mins 8.088 secs 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:45 4) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303) at com.android.dx.command.dexer.Main.run(Main.java:246) at com.android.dx.command.dexer.Main.main(Main.java:215) at com.android.dx.command.Main.main(Main.java:106)

:transformClassesWithDexForDebug UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Landroid/support/annotat ion/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) FAILED

BUILD FAILED

Total time: 1 mins 8.088 secs 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:45 4) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303) at com.android.dx.command.dexer.Main.run(Main.java:246) at com.android.dx.command.dexer.Main.main(Main.java:215) at com.android.dx.command.Main.main(Main.java:106)

FAILURE: Build failed with an exception.

After hours of research I finally managed to build the project by adding the following code to the build.grade in the platform/android folder:

configurations { all*.exclude group: 'com.android.support', module: 'support-v4' }

after the line

apply plugin: 'android'

It seems like both plugins use different sdk versions.

Cheers

Tarmil commented 8 years ago

I had the same issue, another fix for people who don't want to edit a generated file is to use the fork of phonegap-facebook-plugin at https://github.com/Telerik-Verified-Plugins/Facebook instead of the original from https://github.com/Wizcorp/phonegap-facebook-plugin.

EddyVerbruggen commented 8 years ago

+1 for @Tarmil. Btw, I'm also maintaining that one.