I am trying to play along with KMM on Android Stud...
# multiplatform
k
I am trying to play along with KMM on Android Studio, after creating a brand new project with the KMM plugin wizard on my Android Studio, I can run the app to Android Emulator just fine. But when I tried to run it on iOS simulator, I got this error
Task 'embedAndSignAppleFrameworkForXcode' not found in project ':shared'.
I am working with M1 Pro machine. After google a little bit, Seems like I have to run the Xcode using Rosetta and update the Build Setting of the iOS project to exclude
arm64
then I can run the iOS app via Xcode. But I still can't run it using Android Studio due to the same error. So, is that the only workaround to be able to developing KMM app using M1 ? And, when I got Xcode build successfully, why AS still fail to build/run the iOS App? Thanks everyone, and sorry if this is repeated questions. Feel free to refer me to some previous discussion around this.
m
are you using cocoapods?
k
Nope. Im using regular framework.
m
yes but how are you importing it into the ios project?
k
When we select Regular Framework option on the project creation wizard, KMM plugin will add gradle task that will generate *.framework to be consume by iOS app later.
I don't make any changes yet after the project is created. 😅
m
I haven’t created a new project recently and don’t use android studio for the shared code so not sure how it adds the framework. but maybe you need to update the Kotlin version? https://stackoverflow.com/questions/68639738/kmm-error-task-embedandsignappleframeworkforxcode-not-found-in-project-sha
k
I've already using 1.5.30 as default that comes with the project. 🤔 Btw thank you for your replies.
m
did you try uncommenting as mentioned in the last comment (on the stackoverflow page)?
❤️ 1
k
Ah seems like that what I should do first before try to do anything with the Xcode. Yes, it works now, Thanks @michaelv I should revert back the Xcode so it's not running on Rosetta and remove the
arm64
from the excluded arch that I did before.
👍 1