Read Time:48 Second
- When execute
npm run androidfor React Native, the build error occurred as below:
* What went wrong: A problem occurred evaluating project ':app'. > Failed to apply plugin 'com.android.internal.application'. > 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. - changing the JAVA_HOME environment variable. - changing `org.gradle.java.home` in `gradle.properties`.
- It’s because currently Java version is lower than 11.
- Assuming already has another Java JDK, simply change Java for Arch Linux.
$ sudo archlinux-java status Available Java environments: java-17-openjdk java-8-openjdk (default) $ sudo archlinux-java set java-17-openjdk $ java -version openjdk version "17" 2021-09-14 OpenJDK Runtime Environment (build 17+35) OpenJDK 64-Bit Server VM (build 17+35, mixed mode)