App build for Android fails when "multiDexEnabled true" in android/app/build.gradle
Set multiDexEnabled true in android/app/build.gradle
android {
defaultConfig {
...
multiDexEnabled true
}
}
Run: npx react-native run-android
You can find an example rep here:
https://github.com/serbanstef/googlesignintest
Note that it is just a fresh RN project initialisation (react-native init ) with react-native-google-signin installed following your instructions for RN > 0.60
The issue should be reproducible on any RN project (including an empty/new one) with react-native-google-signin > 3.0.0 installed.
Just enable multiDexEnabled true in android/app/build.gradle as showed above and run npx react-native run-android
Build successful.
Build fails with:
Task :app:transformClassesWithMultidexlistForDebug FAILED
FAILURE: Build failed with an exception.
or sometimes
Program type already present: co.apptailor.googlesignin.PendingAuthRecovery
react-native version 0.61.2
@react-native-community/google-signin version 3.0.1
Gradle 5.5
googlePlayServicesAuthVersion = "16.0.1"
hi, thanks for including a repro. The conflict probably happens because of CLI performing autolinking.
Please try removing occurrences of "react-native-google-signin" from android/app/build.gradle and android/settings.gradle. Take a look at the example files: 1 2.
Also, you may need to add implementation 'com.android.support:multidex:1.0.3' (https://developer.android.com/studio/build/multidex#mdex-gradle).
Thanks Vojtek. it worked.
hi, thanks for including a repro. The conflict probably happens because of CLI performing autolinking.
Please try removing occurrences of
"react-native-google-signin"fromandroid/app/build.gradleandandroid/settings.gradle. Take a look at the example files: 1 2.Also, you may need to add
implementation 'com.android.support:multidex:1.0.3'(https://developer.android.com/studio/build/multidex#mdex-gradle).
work for me thanks.
Most helpful comment
hi, thanks for including a repro. The conflict probably happens because of CLI performing autolinking.
Please try removing occurrences of
"react-native-google-signin"fromandroid/app/build.gradleandandroid/settings.gradle. Take a look at the example files: 1 2.Also, you may need to add
implementation 'com.android.support:multidex:1.0.3'(https://developer.android.com/studio/build/multidex#mdex-gradle).