Just exported a new project from <https://kmp.jetb...
# multiplatform
d
Just exported a new project from https://kmp.jetbrains.com/ and trying to run the iOS app yields:
Copy code
* 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
Because Gradle is the tool in charge of orchestrating your entire build, and it requires java to work.
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
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.
I found the gradle settings and it is set to use 17.0.9 jdk
m
I'm not sure those settings affect the terminal, which is the one running your scripts
Try setting up a suitable JAVA_HOME in your environment and relaunch android studio