Issue
I have upgraded react native to 0.68.2 and the android build is failing ever since.
Describe your issue here
When i run
npx react-native run-android
this is the error i get
ERROR:/Users/kamaldeepjayaprakash/Documents/projects/dstreetfinance/dstreet-frontend/node_modules/@react-native-firebase/app/android/build/.transforms/a4a6532b814617c59f54e306212cd90a/transformed/classes/classes.dex: D8: Type io.invertase.firebase.BuildConfig is defined multiple times: /Users/kamaldeepjayaprakash/Documents/projects/dstreetfinance/dstreet-frontend/node_modules/@react-native-firebase/app/android/build/.transforms/a4a6532b814617c59f54e306212cd90a/transformed/classes/classes.dex, /Users/kamaldeepjayaprakash/Documents/projects/dstreetfinance/dstreet-frontend/apps/mobile-df/node_modules/@react-native-firebase/app/android/build/.transforms/9e18e2735b77ba66968224f94e7e09a6/transformed/classes/classes.dex
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Type io.invertase.firebase.BuildConfig is defined multiple times: /Users/kamaldeepjayaprakash/Documents/projects/dstreetfinance/dstreet-frontend/node_modules/@react-native-firebase/app/android/build/.transforms/a4a6532b814617c59f54e306212cd90a/transformed/classes/classes.dex, /Users/kamaldeepjayaprakash/Documents/projects/dstreetfinance/dstreet-frontend/apps/mobile-df/node_modules/@react-native-firebase/app/android/build/.transforms/9e18e2735b77ba66968224f94e7e09a6/transformed/classes/classes.dex
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
I have also raised an issue in react-native's repo :
react/react-native#34021
Project Files
Javascript
Click To Expand
package.json:
firebase.json for react-native-firebase v6:
{
"react-native": {
"android_task_executor_maximum_pool_size": 10,
"android_task_executor_keep_alive_seconds": 3
}
}
iOS
Click To Expand
ios/Podfile:
AppDelegate.m:
Android
Click To Expand
Have you converted to AndroidX?
android/build.gradle:
android/app/build.gradle:
android/settings.gradle:
MainApplication.java:
AndroidManifest.xml:
Environment
Click To Expand
react-native info output:
System:
OS: macOS 12.3.1
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 762.99 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 17.9.0 - /usr/local/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.5.5 - /usr/local/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7678000
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 17.0.2 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: * => 18.2.0
react-native: * => 0.68.2
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
- Platform that you're experiencing the issue on:
react-native-firebase version you're using that has this issue:
"@react-native-firebase/analytics": "^14.11.0",
"@react-native-firebase/app": "^14.11.0",
"@react-native-firebase/auth": "^14.11.0",
"@react-native-firebase/crashlytics": "^14.11.0",
"@react-native-firebase/database": "^14.11.0",
"@react-native-firebase/dynamic-links": "^14.11.0",
"@react-native-firebase/in-app-messaging": "^14.11.0",
"@react-native-firebase/messaging": "^14.11.0",
"@react-native-firebase/remote-config": "^14.11.0",
Firebase module(s) you're using that has the issue:
- Are you using
TypeScript?
Issue
I have upgraded react native to 0.68.2 and the android build is failing ever since.
Describe your issue here
When i run
npx react-native run-androidthis is the error i get
I have also raised an issue in react-native's repo :
react/react-native#34021
Project Files
Javascript
Click To Expand
package.json:# N/Afirebase.jsonfor react-native-firebase v6:{ "react-native": { "android_task_executor_maximum_pool_size": 10, "android_task_executor_keep_alive_seconds": 3 } }iOS
Click To Expand
ios/Podfile:# N/AAppDelegate.m:// N/AAndroid
Click To Expand
Have you converted to AndroidX?
android/gradle.settingsjetifier=truefor Android compatibility?jetifierfor react-native compatibility?android/build.gradle:// N/Aandroid/app/build.gradle:// N/Aandroid/settings.gradle:// N/AMainApplication.java:// N/AAndroidManifest.xml:<!-- N/A -->Environment
Click To Expand
react-native infooutput:react-native-firebaseversion you're using that has this issue:"@react-native-firebase/analytics": "^14.11.0",
"@react-native-firebase/app": "^14.11.0",
"@react-native-firebase/auth": "^14.11.0",
"@react-native-firebase/crashlytics": "^14.11.0",
"@react-native-firebase/database": "^14.11.0",
"@react-native-firebase/dynamic-links": "^14.11.0",
"@react-native-firebase/in-app-messaging": "^14.11.0",
"@react-native-firebase/messaging": "^14.11.0",
"@react-native-firebase/remote-config": "^14.11.0",
Firebasemodule(s) you're using that has the issue:e.g. Instance IDTypeScript?NReact Native FirebaseandInvertaseon Twitter for updates on the library.