Hi all, I am working on a KMP project CMP 1.8.1 p...
# multiplatform
r
Hi all, I am working on a KMP project CMP 1.8.1 promised the bundling of the composeResources into the XCFramework. After assembling the debugXCFramework and trying to use it in a iOS sample in XCode the app crashes. Here a copy/paste of a post I put on YouTrack but maybe someone here knows faster?
Copy code
Somehow I still can't use the composeResources in ios.

The project has multi-module set up with Kotlin 2.2, CMP 1.8.2 (& Skie 0.10.4), using an ios-umbrella.

When I run ios-umbrella:assembleDebugXCFramework on Android Studio side and inspect the generated .xcframework I can see that XCFrameworks are created for 2 targets:

ios-arm64
ios-arm64_x86_64-simulator
with one difference:

The ios-arm64 target contains a /Relocations/aarch64 folder (within ./dSYMs/....frameworkdSYM/Contents/Resources) with a [MyProjectName].yml file in it.
That yml file contains a list with an overview of drawable/font resources etc. and some addresses and size information.

The simulator target doesn't have this(?)
Since I am running my ios app via XCode in a simulator:

Does this have anything to do with that I am running into exceptions like below?:

Uncaught Kotlin exception: org.jetbrains.compose.resources.MissingResourceException: Missing resource with path: /Users/.../Library/Developer/CoreSimulator/Devices/A5C47791-3B4E-4A31-8DFC-7AED41EA2C83/data/Containers/Bundle/Application/47E8ED7F-1BAF-48E1-9E8A-E8EF14D38105/Sample.app/compose-resources/composeResources/....ui/font/pt-sans-regular.ttf
👀 1
t
cc @Konstantin Tskhovrebov
k
@Timofey Solonin 🏓
😅 1
t
Can you please attach a reproducer to the YouTrack issue? cc: @Andrey Yastrebov
r
Found the culprit: It turned out that in the ios-umbrella gradle configuration the jetbrainsCompose and the composeCompiler plugins weren't applied and apparently this is required to not run into the above MissingResourceException.
plugins {
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.composeCompiler)
}
👍 2