Setup: 2020 MacBook Air M1 8GB // Xcode 15.3 // Android Studio Iguana 2023.2.1
I run into the famous PhaseScriptExecution error while building the "iosAPP" of my KMP project. The error occurs when I try to build via Xcode and Android Studio as well. It does not matter if I create the project directly inside Android Studio or through Jetbrains´ KMP wizard. The error only occurs with the iOS part of the project. I can build and run the App without problems on an Android device or emulator.
I found some workarounds on the internet which advise to change some lines in the framework.sh data. But in my projects there is no framework.sh data. No matter if I init a pod or not. Here is my project (it is just the standard project, created through Android Studio).
Kdoctor is complaining that Cocoapods is not installed, even if it is and works well in standard Xcode projects.
Here are the error messages I get:
Kdoctor
Environment diagnose (to see all details, use -v option):
[✓] Operation System
[✓] Java
[✓] Android Studio
[✓] Xcode
[!] CocoaPods
! CocoaPods configuration is not required, but highly recommended for full-fledged development
✖ System ruby is currently used
CocoaPods is not compatible with system ruby installation on Apple M1 computers.
Please install ruby via Homebrew, rvm, rbenv or other tool and make it default
Detailed information: https://stackoverflow.com/questions/64901180/how-to-run-cocoapods-on-apple-silicon-m1/66556339#66556339
✖ CocoaPods requires your terminal to be using UTF-8 encoding.
Consider adding the following to ~/.zprofile
export LC_ALL=en_US.UTF-8
Conclusion:
✓ Your operation system is ready for Kotlin Multiplatform Mobile Development!
Xcode build error
Command PhaseScriptExecution failed with a nonzero exit code
Way more detailed Android Studio build error
Too many characters... view here