While developing an app I came into following error. I tried downgrading the java version from 11 to 8, but that wasn\'t helpful.
FAILURE: Build failed with
I had this issue too and I was able to fix it by creating a new project in react-native 0.57.3 using the command:
react-native init --version="0.57.3" MyNewApp
You have to update the gradle-wrapper.properties file to use the newest version of gradle:
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
And remove this block from build.gradle file:
task wrapper(type: Wrapper) {
gradleVersion = '5.2.1'
distributionUrl = distributionUrl.replace("bin", "all")
}
Then run a gradlew clean on the android folder and everything should work.