Closed Gabotron-ES closed 2 years ago
Maybe you have a specified path in your gradle.properties
?
Are you sure you're actually using the Java 11 version you installed @Gabotron-ES? Do you have 2 versions of Java side-by-side? Are you using JEnv or any other version manager?
I hit this problem too, but then did this to make it work:
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
Closing as the solution was already provided. The original reporter @Gabotron-ES is unresponsive so I assume the problem is resolved.
I hit this problem too, but then did this to make it work:
compileOptions { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 }
Hi my friend ,could you please let me know where can you find this in VScode ? I could not find it at any file ..Thank you so much !
@DongjingZhong in android/app/build.gradle
android {
ndkVersion rootProject.ext.ndkVersion
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
flavorDimensions "default"
...
Thank you so much Adam !
- install idk 11;
- AndroidStudio->file->ProjectStructure->click Gradle Settings->choose idk 11 ->sync;
This worked for me but I had to restart VS code since I am using that to run my react-native project. Only restarting the VS Code's terminal won't work.
thank you so much))I solved problem
Description
I downloaded java version 11 from here: https://www.oracle.com/java/technologies/javase/jdk11-archive-downloads.html
I check my java version with java -version command wich prints:
But I'm still getting same error, why is it not recognizing new version?
My android build gradle file
My package.json file:
Version
^0.68.1
Output of
npx react-native info
Steps to reproduce
cd C:\xampp\htdocs\AdoptaTias && cd android && gradlew clean && cd .. && npx react-native run-android -- --reset-cache
Snack, code example, screenshot, or link to a repository
No response