React Native Task :app:mergeDexDebug FAILED

Here is the solution, if you encounter  mergedexdebug failed


At Path android/app/build.gradle


defaultConfig {
multiDexEnabledtrue //Add this line
}