Anybody know what targetCompatibility value to use for JDK 10? Supposedly Gradle 4.7 supports it.
e: Currently using 1.10
but I can't find any confirmation that this is correct. java --version
reports 10.x
instead of the usual 1.x.x
format.
You can keep your project's source and target compatibility values set to Java 7, but you still need to compile using JDK 8. The Android Gradle plugin provides built-in support for using certain Java 8 language features and third-party libraries that use them.
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. You can try some of the following options: - changing the IDE settings.
When using an outdated version of Android Studio, you may encounter the following error message: > Failed to apply plugin 'com. android.
Set the Gradle version & Java Version in build.gradle as below
task wrapper(type: Wrapper){
gradleVersion = '4.7'
}
sourceCompatibility = JavaVersion.VERSION_1_10
targetCompatibility = JavaVersion.VERSION_1_10
Now, right click the build.gradle->Gradle->Refresh Gradle Project. And check the JRE System Library (Package Explorer view) contains JavaSE-10
Note: I am using Eclipse Oxygen IDE with Gradle IDE plugin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With