My android/app/build.gradle (bottom):
dependencies {
compile project(':react-native-onesignal')
compile project(':react-native-youtube')
compile(project(":react-native-google-sign-in")) {
exclude group: "com.google.android.gms"
}
compile project(':react-native-svg')
compile project(':react-native-facebook-login')
compile project(':react-native-i18n')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.google.android.gms:play-services-auth:10.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply plugin: 'com.google.gms.google-services'
My android/build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
The error:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/auth/api/signin/zzc;
I’ve tried various solutions and nothing works :/
Seems to be some sort of version mismatch, but I don’t know how to match it.
2
Answers
The solution to the issue was the following:
My build.gradle had this line:
So I had to change /node_modules/react-native-onesignal/android/build.gradle like this:
This is the only thing that worked after trying all other solutions I found online.
just enable multidex as following:
create one class like this
now in your manifiest file add this