Solution to some pain points on which I spent a lot of time when working with Kotlin Multiplatform Mobile (KMM) and Xcode, this will be updated as I find more issues.

Cannot find JAVA_HOME variable

For some reason Xcode is unable to find java when running the gradlew script and throws a PhaseScriptExecution failed with a nonzero exit code error.

To fix this, we can add the following in the settings:

Xcode Settings