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-whenSome 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?
3 months ago
[SOLVED ✅] I have a strange bug when building the shared xcframework. Everything works fine on my Mac Intel but it fails on a M1 Mac with the error
Task 'embedAndSignAppleFrameworkForXcode' not found in project ':shared'.
. Is there a cache or something on the M1 Mac ? It could be related to the kotlin version used but how can I verify ? Is this task unavailable on M1 Macs ?
I'm trying to understand what the best approach is to create a multiplaform app that runs on Android phone, Android Wear, iPhone and iWatch with a shared library. In my post from yesterday I was using Cocoapods for the shared library, but this gives me such a big headache, maybe I have to use XCFramework?I just tried to get it to work with an empty (new) Kotlin Multiplatform App project from Android Studio to get the "Hello, <<platform>>" demo running with the "Regular framework". It runs on the iPhone, but after adding the watchOS target in XCode, the problems start. I have uploaded the demo project to github: https://github.com/Chris-NL/DemoBuilding and running for iPhone works fine. Building for WatchOS works fine, but give me a warning: "linking against a dylib which is not safe for use in application extensions". When trying to run on the iWatch gives xCode gives me an installation error: "A signed resource has been added, modified, or deleted."I tried adding isStatic = true to build.gradle.kts, although that does remove the warning for watchOS, it results in installation errors on the iPhone.iMac (Retina 5K, 27-inch, Late 2015 with an 3,3 GHz Quad-Core Intel Core i5 running MacOS Montery 12.4)
Android Studio Chipmunk
all the latest plugins installedAnyone a clue on how to get this poperly to work?
2 months ago
I'm getting this error after calling a fun that returns a Promise:
Unhandled Runtime Error TypeError: hidden._get_entries__31877249_iz8n5_k$ is not a function
browser request is responding 200Any idea?The fun in js target: