https://kotlinlang.org logo
p

Paul Woitaschek

12/08/2020, 7:41 AM
We're having issues with building a shared framework:
Both watchos-armv7k and watchos-arm64_32 represent two equivalent library definitions.
We're building the framework like this:
Copy code
xcodebuild -create-xcframework \
-framework ios/build/xcode-frameworks/iosArm64/SharedCode.framework \
-framework ios/build/xcode-frameworks/iosX64/SharedCode.framework \
-framework ios/build/xcode-frameworks/watchosArm64/SharedCode.framework \
-framework ios/build/xcode-frameworks/watchosX86/SharedCode.framework \
-framework ios/build/xcode-frameworks/watchosArm32/SharedCode.framework \
-output "$XCFRAMEWORK_DESTINATION_DIR"/SharedCode.xcframework
Did someone manage to get arm32 and arm64 working together for kotlin native on ios / watchos?
@Kai Limadjaja cc
l

louiscad

12/08/2020, 7:52 AM
@Paul Woitaschek Can you try making a XCFramework with this project? https://github.com/ge-org/multiplatform-swiftpackage
k

Kai Limadjaja

12/08/2020, 7:57 AM
@louiscad what Platforms are you targeting with the ``watchOS { v("xxx") }`` shortcut in your configuration DSL?
l

louiscad

12/08/2020, 8:10 AM
@Kai Limadjaja I didn't use it for a watchOS project yet, but it worked nice for iOS x64 + iOS arm64
k

Kai Limadjaja

12/08/2020, 8:15 AM
It looks promising. Could you point me to the file in the project where the actual build is assembled from the DSL config?
p

Paul Woitaschek

12/08/2020, 8:30 AM
Thats the same:
Both watchos-arm64_32 and watchos-armv7k represent two equivalent library definitions.
@sergey.bogolepov You wrote something about changing it in the ide, but it doesn’t build in the first place
s

sergey.bogolepov

12/08/2020, 9:54 AM
IDK, your error is different from the one from the issue. What are your Xcode and kotlin version?
p

Paul Woitaschek

12/08/2020, 9:56 AM
It's kotlin 1.4.20 and Xcode 12.2
Just run
./bug.sh
Then you’ll get the error as above:
Both watchos-arm64_32 and watchos-armv7k represent two equivalent library definitions.
s

sergey.bogolepov

12/08/2020, 10:30 AM
Thanks, I'll see what I can do!
It looks like a bug in
xcodebuild -create-xcframework
. What worked for me is creation of a fat framework from
watchosArm32
and
watchosArm64
and then adding it to xcframework instead of separate ones. Yeah, it is opposite to xcframework's motivation (moving away from fat frameworks), but there is neither documentation nor official answers on Apple developer forum, so... ¯\_(ツ)_/¯
p

Paul Woitaschek

12/09/2020, 6:06 PM
Hm it's not showing up on a arm32 watch :(
We tested it on a watch series 3
@sergey.bogolepov do you have any link for an upstream bug? Due to this we have hit the 75mb limit
l

louiscad

12/11/2021, 3:14 PM
What limit are you referring to?
p

Paul Woitaschek

12/11/2021, 3:17 PM
Watch apps can't be larger than 75mb
l

louiscad

12/11/2021, 3:18 PM
Per architecture?
Or did you actual get some rejection from the App Store?
p

Paul Woitaschek

12/11/2021, 3:19 PM
The latter
ITMS-90389: Size Limit Exceeded - The size of watch application '/Payload/YAZIO.app/Watch/watchOS.app' (75MB) has exceeded the 75MB size limit. I don't fully understand the iOS structure, and if this is really caused by fat frameworks
l

louiscad

12/11/2021, 3:34 PM
Built in release mode?
p

Paul Woitaschek

12/11/2021, 4:13 PM
Yep
s

sergey.bogolepov

12/13/2021, 10:00 AM
do you have any link for an upstream bug?
Unfortunately, no.
6 Views