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.

Gradle distribution needs to be updated in order to work with JDK v9

See original GitHub issue

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment: OS: macOS Sierra 10.12.6 Node: 8.7.0 Yarn: 1.2.1 npm: 5.5.1 Watchman: 4.9.0 Xcode: Xcode 9.0.1 Build version 9A1004 Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed) react: 16.0.0-beta.5 => 16.0.0-beta.5 react-native: 0.49.3 => 0.49.3

Steps to Reproduce

  1. Update to JDK version 9+
  2. run react-native run-android

Expected Behavior

Should build android files correctly

Actual Behavior

Errors with following details

FAILURE: Build failed with an exception.

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

Solution seems to be described here: https://discuss.gradle.org/t/could-not-determine-java-version-from-9-0-1/24457 I tried it and got past the error, but had issues when opening project in my android studio, so am not sure if further steps are required.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:34
  • Comments:17 (2 by maintainers)

github_iconTop GitHub Comments

212reactions
gregogalantecommented, Nov 2, 2017

This work for me:

Edit the file /android/gradle/wrapper/gradle-wrapper.properties and update the last line with:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-2-all.zip

So i update the gradle version used for project dependencies.

74reactions
lndgalantecommented, Dec 19, 2017

What it works for me was to rollback to Java8

brew cask uninstall java
brew tap caskroom/versions
brew cask install java8
Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrading your build from Gradle 7.x to the latest
This chapter provides the information you need to migrate your Gradle 7.x builds ... Run gradle wrapper --gradle-version 7.6 to update the project...
Read more >
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 Enterprise version compatibility
Major or minor version updates to the Gradle Enterprise Gradle plugin indicate a compatibility change with Gradle Enterprise (e.g. 3.0 → 3.1 or...
Read more >
Known issues with Android Studio and Android Gradle Plugin
Starting with version 4.2, Android Studio now runs on JDK 11. This update causes an underlying behavior change related to signing keys.
Read more >
Known Issues for JDK 8 - Oracle
In some circumstances, the Java Control Panel reports the JRE platform version as 1.7 instead of 1.8 when upgrading an older JRE in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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