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.

Upvotes: 3

Views: 4589

Answers (2)

Akshit W.
Akshit W.

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

Ryotsu
Ryotsu

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.

  • 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

Upvotes: 11

Related Questions