Reputation: 33
Java version: 11.0.1 React Native version: 0.57.5 React Native CLI version: 2.0.1
Android device is connected and given access, tuned on debug via USB
When I run neact-native run android I get this following error:
Starting JS server... Building and installing the app on the device (cd android && gradlew.bat installDebug)...
FAILURE: Build failed with an exception.
What went wrong: Could not determine java version from '11.0.1'.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org Could not install the app on the device, read the error above for details. Make sure you have an Android emulator running or a device connected and have set up your Android development environment: https://facebook.github.io/react-native/docs/getting-started.html
Upvotes: 3
Views: 4589
Reputation: 99
I was having the same issue. I update the gradle version to gradle-4.8-all.zip in the following file in disributionUrl:
[your-react-native-project]/android/gradle/wrapper/gradle-wrapper.properties
It solved the issue.
Upvotes: 1
Reputation: 806
You seem to be using an older version of Gradle, from 4.8+ your project should build
The below directory gradle/
is in whichever directory gradlew
or gradlew.bat
is in.
gradle-wrapper.properties
located in ./path-to-project-root/gradle/wrapper
distributionUrl:...
with the followingdistributionUrl=http\://services.gradle.org/distributions/gradle-5.0-bin.zip
Upvotes: 11