compose-multiplatform
compose-multiplatform copied to clipboard
When running iOS by defining cocoapods, the resources in the ComposeResource folder are not copied
- iOS
Versions
- Kotlin version*: 1.9.22
- Compose Multiplatform version*: 1.6.0-rc01
https://github.com/JetBrains/compose-multiplatform-ios-android-template
In the repository example, only the iOS settings section was changed to Cocoapods settings, so the contents of the ComposeRource folder were not copied when run.
Hi! Did you migrate your Xcode project to the cocoapods as well?
https://kotlinlang.org/docs/native-cocoapods.html
The guide section of the site has been applied. Are any additional settings required?
When running on Android, the image is displayed normally, but on iOS, the image is not copied and a crash occurs.
Image( painterResource(Res.drawable.compose_multiplatform), null )
you are suppose to close Xcode and call pod install
again after first build.
it is an issue with cocoapods that it needs generated resources on a disk to configure Xcode project properly
In other words: shared.podspec
contains a line spec.resources = ['build/compose/ios/shared/compose-resources']
but cocoapods ignore it if the directory is empty.
Cocoapods ignore it if the directory is empty. I don't understand. Please see the links to related samples below.
https://github.com/carter-rs/compose-multiplatform-ios-android-template-main
When using the cocoapods framework, the two Tasks checkCanSyncPodComposeResourcesForIos and syncPodComposeResourcesForIos are not called.
As i said before you have to call the 'pod install' command in the ios dir after the first build
I'm having the same issue and I think I'm doing a pod install after the first ios build (even after an android build)
I fail to see what am I missing.
@Shusshu could you check your podspec file and if it declares the resources dir then check it as well
My setup it slightly different as I have a shared UI within the compose module, I only need cocoapods to setup GoogleMaps - Without cocoapods everything was working fine.
spec.resources = ['build/compose/ios/composeApp/compose-resources']
Which task is supposed to fill that directory? It used to contain the fonts, strings, etc - still the iOS app was crashing as it couldn't find the resources.
After cleaning that directory, I wasn't able to generate it again during build.
How do you integrate the podspec to your xcproject?
Thank you very much, I tried so many things so late it was getting ridiculous.
Your question nailed it, I re-added pod 'composeApp', :path => '../composeApp'
into the podfile and 💥 it works as expected.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.