oney / react-native-gcm-android

GCM for React Native Android
MIT License
172 stars 76 forks source link

Getting DexException when using react native 0.18.0 #34

Closed onchainguy-btc closed 8 years ago

onchainguy-btc commented 8 years ago

I am trying to use this plugin with react native 0.18.0. These are my gradle dependencies:

dependencies {
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:0.18.+"
    compile 'com.google.android.gms:play-services-gcm:8.1.0'
    compile project(':RNGcmAndroid')
    compile project(':react-native-system-notification')
    compile project(':react-native-image-picker')
    compile project(':react-native-contacts')
}

and this is the error message I receive

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/facebook/infer/annotation/Assertions;
    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)

Does somebody have a clue how to solve this?

onchainguy-btc commented 8 years ago

Sorry, issue was related to another Android library :-(

lynndylanhurley commented 8 years ago

@seb0zz - what was the issue exactly? I'm running into the same problem.

Traviskn commented 8 years ago

I am also having this issue, using react-native 0.19.0. I do not have multiDexEnabled set to true anywhere in my build.gradle files. I've even tried setting it explicitly to false and still no luck.

When I run react-native run-android I see this message on the console as it is building :app:transformClassesWithDexForDebug So it seems something at the framework level is running the Dex transformations?