Skip to content

[馃悰] Android build error after upgrading to new architecture#6315

Description

@kamal-j

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:

# N/A

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:

  • I'm not using Pods
  • I'm using Pods and my Podfile looks like:
# N/A

AppDelegate.m:

// N/A


Android

Click To Expand

Have you converted to AndroidX?

  • my application is an AndroidX application?
  • I am using android/gradle.settings jetifier=true for Android compatibility?
  • I am using the NPM package jetifier for react-native compatibility?

android/build.gradle:

// N/A

android/app/build.gradle:

// N/A

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->


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:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • 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:
    • e.g. Instance ID
  • Are you using TypeScript?
    • N


Metadata

Metadata

Assignees

No one assigned

    Labels

    Keep Openavoids the stale botType: StaleIssue has become stale - automatically added by Stale botblocked: react-nativeIssue or PR blocked by a React Native issue or change.help: needs-triageIssue needs additional investigation/triaging.type: bugNew bug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions