ReactNative, Android run error: Could not determine java version from '11.0.1'. Windows 10

Бекболот Тажибаев :

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

Ryotsu :

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.

  • Edit the file called gradle-wrapper.properties located in ./path-to-project-root/gradle/wrapper
  • Replace distributionUrl:... with the following

distributionUrl=http\://services.gradle.org/distributions/gradle-5.0-bin.zip

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=85480&siteId=1