apk作成時のエラー
環境構築はこちらを参考
https://qiita.com/ryome/items/7e95279eeffbf231b1ba
環境
Node 20.11.1
Java 17
Android Stadio 2023.2.1
react-native-cli: 2.0.1
react-native: 0.73.6
エラー内容
上記で環境構築中「gradlew bundleRelease」を実行
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\work\node\react-native-app\android\app\build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.android.internal.application'.
> Android Gradle plugin requires Java 17 to run. You are currently using Java 11.
Your current JDK is located in D:\Program Files\java
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`.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
javaのバージンが古く17にしてくださいと言われたのでダウンロード解凍して、環境変数を変更して再度実行
https://jdk.java.net/java-se-ri/17
メッセージにそのまま記載されていますが、備忘録的に残しておきます