question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not determine java version from '9.0.4'.

See original GitHub issue

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment: OS: Linux 4.13 Node: 9.4.0 Yarn: Not Found npm: 4.6.1 Watchman: Not Found Xcode: N/A Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed) react: 16.2.0 => 16.2.0 react-native: 0.52.0 => 0.52.0

Steps to Reproduce

  1. Plugged an Android phone, enabled developer mode and debugging and confirmed that adb is recognised the device by running adb devices
  2. Followed the official docs and created a react-native app called AwesomeProject using react-native init AwesomeProject command.
  3. Changed the directory to inside the project and ran react-native run-android

Expected Behavior

Start the AwesomeProject in connected Android Device.

Actual Behavior

Didn’t start the app on my mobile. Error on console appeared.

Scanning folders for symlinks in /home/pankaja/Documents/Projects/react-native/AwesomeProject/node_modules (7ms)
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '9.0.4'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
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/android-setup.html
^C
pankaja@pankaja-HP-Pavilion-15-Notebook-PC:~/Documents/Projects/react-native/AwesomeProject$ react-native info

Screenshot

Reproducible Demo

react-native init AwesomeProject
cd AwesomeProject
react-native run-android

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:25 (2 by maintainers)

github_iconTop GitHub Comments

20reactions
katerynajeevacommented, Jan 22, 2018

just in case you need a quick fix, you can uninstall JDK 9 and install JDK 8 instead

11reactions
azmanahmed21commented, Feb 9, 2018

Hey, I had the same issue. I went to the gradle. properties file and changed the version in the ‘distributionUrl’ field to the latest version.

distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gradle: Could not determine java version from '11.0.2'
The obvious way, would be to update your project's gradle-wrapper to version 5.0. However, before updating, try running gradle app:installDebug ...
Read more >
Gradle - could not determine java version 11.0.8 or any ...
A quick guide to fix could-not-determine-java-version when working with Gradle tool for any Gradle version.
Read more >
Could not determine java version from '9.0.1' - Gradle Forums
I fixed it by changing distributionUrl in the file [project]\gradle\wrapper\gradle-wrapper.properties to point to disribution of version 4.3. ( ...
Read more >
Solved : Could not determine java version when running gradle
BuildExceptionReporter ] Could not determine java version from '9.0.4'. 21:04:36.822 [ERROR] [org.gradle.internal.buildevents.
Read more >
Android : Could not determine java version from '9.0.1' - YouTube
Android : Could not determine java version from '9.0.1' [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] Android : Could not determine ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found