I\'ve tried gradlew clean and every other solution available here and on GitHub but the error doesn\'t match and solution doesn\'t work
Error on cmd A
Just run
cd android && gradlew clean
then
cd .. && react-native run-android
As an update to this answer (if people can't figure out why, especially one Mac)
use sudo! I was trying to figure out why gradlew commands were not running for ages, turns out - it didnt have permission!
Use:
sudo ./gradlew [command]
I'm so frustrated and happy at the same time.
I have the same issue. So to make it 'clearer', I did these:
multidexEnabled=true
in the same section as no (1) above(Optional) - I had another issue where Gradle couldn't find the play-services version properly: I modified the project build.gradle
to search the google maven first before the jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
mavenLocal()
jcenter()
Open the /android/app/build.gradle file.
Under dependencies we need to add the module, and then enable it within defaultConfig
android {
defaultConfig {
// ...
multiDexEnabled true
}
// ...
}
dependencies {
implementation 'com.android.support:multidex:1.0.3'
}
me too had this same error, and i was able to debug it using the command ./gradlew assembleDebug --stacktrace
(inside android folder) and for me it was because i had two libraries and both were having same package name, on changing package name of one resolved the issue