Command PhaseScriptExecution failed with a nonzero exit code
KMP Projectを新しく立ち上げたMacのXcodeでビルドしたときに発生。
AndroidStudio経由でのビルドはできていて、Xcodeでのみビルドができない状態。
詳細Log
Showing Recent Issues
PhaseScriptExecution Compile\ Kotlin\ Framework /Users/xxx/Library/Developer/Xcode/DerivedData/iosApp-evfdmqvopnrwzleatsmqsudukdaz/Build/Intermediates.noindex/iosApp.build/Release-iphoneos/iosApp.build/Script-YYYY.sh (in target 'iosApp' from project 'iosApp')
(略)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
Starting a Gradle Daemon (subsequent builds will be faster)
Calculating task graph as configuration cache cannot be reused because init script '../../../../private/var/folders/m5/7g6dzw_s21d29yknbrvy650c0000gn/T/ijMapper1.gradle' and 3 more have been removed.
FAILURE: Build failed with an exception.
* What went wrong:
25.0.1
* 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.
BUILD FAILED in 3s
Configuration cache entry stored.
Command PhaseScriptExecution failed with a nonzero exit code
Geminiの解析
詳細Logをみてもわけがわからないので、Geminiにお願いすると、
* What went wrong:
25.0.1
Java versionじゃない?との回答。確かにAndroidStudioはビルドインされているのは21なのであやしい。
Java version変更方法
@.zshrc
export JAVA_HOME=`/usr/libexec/java_home -v "21"`
PATH=$JAVA_HOME/bin:$PATH
なぜか、25.0.1をuninstallしないと有効化できなかったので、
sudo rm -rf /Library/Java/JavaVirtualMachines/openjdk.jdk