Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Program type already present: io.invertase.firebase.BuildConfig

Tags:

react-native

Based on some googling, it seems that there is some overlap between 2 packages. I've encountered a similar issue in the past and I think I was able to fix it with ./gradlew clean, but that isn't fixing my current issue. Here's the error:

Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'.

com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: Program type already present: io.invertase.firebase.BuildConfig

I started encountering this issue as I was trying to get react-native-firebase wired up into my application. Here are a few relevant dependencies in my package.json file:

"@react-native-firebase/app": "^6.0.3",
"@react-native-firebase/database": "^6.0.3",
"firebase-auth": "^0.1.2",
"react-native-firebase": "^5.5.6",

Do I need to uninstall one of these packages or is it possible that I made a wireup mistake in a file like build.gradle, MainApplication.java?

like image 782
random512 Avatar asked Oct 31 '19 15:10

random512


1 Answers

Once manually removing the ./node_modules/react-native-firebase folder, I was able to successfully run: npx react-native run-android

I was able to successfully react-native run-android

like image 127
Keshav Gera Avatar answered Nov 04 '22 04:11

Keshav Gera