* What went wrong:
An exception occurred applying plugin request [id: 'com.android.application', version: '8.1.4']
> Failed to apply plugin 'com.android.internal.application'.
> Android Gradle plugin requires Java 17 to run. You are currently using Java 15.
Your current JDK is located in /Library/Java/JavaVirtualMachines/jdk-15.0.2.jdk/Contents/Home
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`.
Why is it trying to use java for iOS?
I'm not sure where to look in the project, I struggle with where to keep track of JDK/Gradle settings in AndroidStudio, seems like its moved around. I thought the embedded java in A/S was 17. Any advice?
m
McEna
12/26/2023, 9:04 PM
Because Gradle is the tool in charge of orchestrating your entire build, and it requires java to work.
McEna
12/26/2023, 9:06 PM
while xcode terminal tools are indeed in charge of building and deploying IPA files, somebody has to prepare the sources and call them. That somebody is Gradle.
d
Dave Trollope
12/27/2023, 3:20 AM
that was my first thought too, but the android project builds and runs fine, only the iOS app doesn't. Gradle would be used for both.
Dave Trollope
12/27/2023, 3:38 AM
I found the gradle settings and it is set to use 17.0.9 jdk
m
McEna
12/27/2023, 6:36 AM
I'm not sure those settings affect the terminal, which is the one running your scripts
McEna
12/27/2023, 6:36 AM
Try setting up a suitable JAVA_HOME in your environment and relaunch android studio