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
Just run sudo react-native run-android and it will build and install ./gradlew app:installDebug inside android directory for you.
sudo react-native run-android