Task :app:transformDexArchiveWithDexMergerForDebug FAILED In React Native

By React Native Debugger

If your methods + your dependencies method greater then 64k+ methods then your react native throwing DexMerger error.

Follow some simple steps you absolutely solved this error.

Image for post

Step 1: Enable MultiDex

Dir - Project/Android/app/build.gradleandroid {
defaultConfig {
minSdkVersion 15
targetSdkVersion 28
multiDexEnabled true // add this line

Step 2: Add Multidex dependencies

Dir - Project/Android/app/build.gradledependencies {
def multidex_version = "2.0.1"
implementation 'androidx.multidex:multidex:$multidex_version'

Step 3: Change Your Extends Application

Dir - Project/android/app/src/main/java/com/Project/MainApplicationpublic class MainApplication extends MultiDexApplication implements ReactApplication {

Step 4: Run Your Project

Project> cd android
Project> gradlew clean
Project> cd ..
Project> npx react-native run-android

Please clap for your solved error…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store