You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
com.android.dex.DexException: Multiple dex files define in android app #299
After adding react-native-firestack I've got this error
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzble;
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)
:app:transformClassesWithDexForDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
I just had this error, this is how I managed to fix it.
Change compile project(':react-native-firestack')
To compile(project(':react-native-firestack')){ exclude group: 'com.google.android.gms' }
On your android/app/build.gradle file.
Hope it works for you!
Reacted by Juan S. Escobar, Arnold Gandarillas Castillo, Martín Varela, Juan Carlos Lloret Hernández, Markus Ranner, Michael Campsall, haimyyy, Corey Henderson, Puthy Mol, Huy Nguyen and 3 more
Reacted by Juan Carlos Lloret Hernández, Markus Ranner and haimyyy
I'm facing the same issue here,
these are my dependencies in app/build.gradle
dependencies {
compile(project(':react-native-firestack')){
exclude group: "com.google.android.gms" // very important
}
compile project(':react-native-facebook-login')
compile project(':react-native-vector-icons')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+"
compile(project(":react-native-google-signin")){
exclude group: "com.google.android.gms" // very important
}
compile 'com.google.android.gms:play-services-auth:9.2.1' // should be at least 9.0.0
}
Do you see something that may be causing problems?
@maggialejandro I had this issue too even after the fixes. I was able to solve it by loosening the dependencies in the gradle file for firestack as mentioned in #290. I don't know if there's any intention of merging this.
Go the Gradle and move cursor on each library if there is updated version available then update the library then sync the Gradle. Actually I was up to this problem for 2 days I tried every method but did not solve it. then I updated the library, sync the gradle and run agian. it worked for me.
Activity
oiaren commentedon Mar 4, 2017
I just had this error, this is how I managed to fix it.
Change
compile project(':react-native-firestack')To
compile(project(':react-native-firestack')){ exclude group: 'com.google.android.gms' }On your
android/app/build.gradlefile.Hope it works for you!
BlakeRxxk commentedon Mar 5, 2017
@GDuarteL, thank you! work like a charm!
maggialejandro commentedon Mar 16, 2017
I'm facing the same issue here,
these are my dependencies in app/build.gradle
Do you see something that may be causing problems?
jdmunro commentedon Mar 28, 2017
@maggialejandro I had this issue too even after the fixes. I was able to solve it by loosening the dependencies in the gradle file for firestack as mentioned in #290. I don't know if there's any intention of merging this.
rahulsharma29 commentedon Jun 12, 2017
I am also getting the same error
Error:Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Lai/api/AIListener;
Error:Execution failed for task ':apiAISampleApp:transformClassesWithDexForDebug'.
My build.griddle is as fallows
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
defaultConfig {
applicationId 'ai.api.sample'
minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION)
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
versionCode Integer.parseInt(project.VERSION_CODE)
versionName project.VERSION_NAME
}
buildTypes {
release {
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'LICENSE.txt'
}
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.google.code.gson:gson:2.3.1'
compile 'commons-io:commons-io:2.4'
compile 'ai.api:libai:1.4.8'
compile 'ai.api:sdk:2.0.5@aar'
// compile 'ai.api:sdk:2.0.4@aar'
// this line is for testing purposes
compile project(':ailib')
}
Opriday commentedon Nov 13, 2017
Go the Gradle and move cursor on each library if there is updated version available then update the library then sync the Gradle. Actually I was up to this problem for 2 days I tried every method but did not solve it. then I updated the library, sync the gradle and run agian. it worked for me.
kaxhiftaj-zz commentedon Dec 13, 2017
@Opriday yes this worked for me. Thanks
firedancerx commentedon Dec 26, 2017
Hi guys,
I have this combination of dependencies. Does anyone know which one is to be changed, and to what? The bold lines are the ones with problems.
Thanks