Development issue/problem:
Try loading the project into bintray and you will only get an error message:
Cannot identify the Java version of 9.0.1.
I read that it was a sorting error and that it was corrected in the higher versions. I tried to change the sorting version
to 4.2.1, but I got another error:
Weighing the properties :
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/mounting
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/mounting
distributionUrl=https://services.gradle.org/distributions/gradle-4.2.1-all.zip
Hard-scale construction project
script {
ext.kotlin_version = 1.1.51
Repositories {
google()
jcenter()
}
dependencies {
classpath ‘com.android.tools.build:gradle:3.0.0-beta7’
classpath org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version
classpath ‘com.novoda:bintray-release:0.5.0
// NOTE : Do not place your application dependencies here, they belong to
// in separate build.gradle
} module files.
}
all projects {
repositories {
google()
jcenter()
}
}
task clean(type: Remove) {
remove rootProject.buildDir
}
How can I solve this problem?
Solution 1:
The Java JDK also needs to be uninstalled. Just do as follows:
- CD /Library/Java/Java Virtual Machines
- sudo rm -rf jdk1
Now make sure you type java into the terminal.
Further links can be found here: https://www.howtogeek.com/230145/how-to-uninstall-java-on-mac-os-x/.
Solution 2:
This problem has been addressed in section 4.3. Please update your gradle.properties to version 4.3 or higher:
distributionUrl=https://services.gradle.org/distributions/gradle-4.3-all.zip
Why did this error occur?
Because you have a different JDK on your system than the android-studio version of the JDK.
Your JDK must therefore be compatible with others, and if you follow this path, you can do so:
File -> Other parameters -> Default project structure
You can use the built-in JDK or your own JDK.
You may also have problems with the terminal, and this has to do with a conflict between different JDKs.
The solution that worked for me was to remove the Java 9 JDK.
Solution 3:
I had this problem on macOS, and I fixed it:
Remove the too new jdk java
java de-installation barrel
And the installation of the old
Brewery / versions
Brewery java8
It was all in Hebrew.
Solution 4:
In my case, the mistake was
Cannot identify Java version 10.
I went to the Unity settings (Edit > Settings in Windows or Unity > Settings in MAC), the external tools, the JDK directory and I changed, I went up a few levels. I used JDK 10, but I changed the file to JDK 8 and that solved the problem.
Solution No 5:
I just tried to build with Gradle 4.3, against JDK 9.0.1 –
, it can work in Android Studio (because the included JDK is the old version), but not with Jenkins 2.89.2 (which seems not to support JDK 9.0.1 yet, literally complaining that C could not detect the Java version of 9.0.1). bintray can also be built with Jenkins, because the error message is somewhat identical.
Downshifting to 8 JDK in gradle.properties solved the problem for me:
org.gradle.java.home=/usr/java/jdk1.8.0_152
combined with the envelope properties of the grade :
distributionUrl=https://services.gradle.org/distributions/gradle-4.1-all.zip
Solution No 6:
Just use the local distribution of the
Ex-diplomas: In IntelliJ, go to File->Settings->Build,Run,Deployment->Build Tools->Gradle, then update Use local gradle distribution as shown.
Settings window
Solution No 7:
Make sure your files are available under the JDK. I had the same problem because my process couldn’t access the JDK files because of a proxy problem. Then I changed my JDK. It worked.
Good luck!
Related Tags: