With Kotlin I've created a shared module in Android Studio on my Windows 10 laptop that is used by my Android Mobile and Watch devices without any issues. Since I also wanted to build an IOS and WatchOS app, I've moved the shared library to a new Kotlin MultiPlatform Project in Android Studio Chipmunk on an (older) iMac (Retina 5K, 27-inch, Late 2015 with an 3,3 GHz Quad-Core Intel Core i5 running MacOS Montery 12.4) with xCode 13.4.1. I'm mostly testing on an iPhone 7 and iWatch 7.
App development went pretty smoothly using the iPhone. At some stage I added a WatchOS target in xCode to start the App development for the iWatch. At that point I was using an older Android Studio and xCode 13.x version. All went ok, but at a certain moment getting the App(s) compiled is a nightmare.
I do manage to get the App compiled and running on the iPhone and/or iWatch, but this requires multiple attempts and a lot of patience. Not really helpfull if you're still developing and just want to change something very minor. When building from xCode, the behaviour is very unpredictable, but most of the times it fails. And when it fails is doesn't always have the same outcome. I've put my project on h9ld for a while, but want to pick it up again. I did post another message on stackoverflow, but no luck/help yet:
https://stackoverflow.com/questions/70632359/using-kmm-shared-library-for-use-in-xcode-gives-several-warnings-and-errors-when
Some of the errors I get when building:
• ld: warning: ignoring file /Users/bash/AndroidStudioProjects/XYZ/shared/build/cocoapods/framework/shared.framework/shared, file is universal (armv7k,arm64_32) but does not contain the arm64 architecture: /Users/bash/AndroidStudioProjects/XYZ/shared/build/cocoapods/framework/shared.framework/share
• ld: warning: ignoring file /Users/bash/AndroidStudioProjects/XYZ/shared/build/cocoapods/framework/shared.framework/shared, building for watchOS-arm64_32 but attempting to link with file built for iOS-arm64
• ld: warning: ignoring file /Users/bash/AndroidStudioProjects/XYZ/shared/build/cocoapods/framework/shared.framework/shared, building for watchOS-armv7k but attempting to link with file built for iOS-arm64
I've been playing around with the Excluded Build Architectures, but no luck yet. I also cleaned the project several times. Sometimes it builds (and runs) successfully, but when performing a subsequent build it will most likely fail with an error as mentioned above.
Does anyone have a clue?