-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iosApp] org.jetbrains.compose.resources.MissingResourceException with CocoaPods #4720
Comments
Still failing with:
|
I'm using regular framework and facing the issue! |
We discovered an issue with upgrading from Kotlin 1.9 to 2.0 (or from 2.0 to 1.9). You need to remove all Could you try it? |
@igordmn Unfortunately it doesn't work, I did that when testing (and now again just to double check) |
Still fails with:
|
That is how Cocoapods works: the podspec has a path to resources:
but before the first build the directory doesn't exist. So, if you call To fix the problem you have to:
|
But I see another problem on our side: podspec is being regenerated with a wrong resources path during the project import. I will fix it. |
After the fix the empty directory will be generated automatically. |
Thank you for the report 👍 |
The PR sets a static path to the compose resources for the cocoapods integration because there maybe only one integration framework for a gradle module. Fixes #4720 ## Release Notes ### Fixes - Resources - _(prerelease fix)_ Fix resources with cocoapods integration
The PR sets a static path to the compose resources for the cocoapods integration because there maybe only one integration framework for a gradle module. Fixes #4720 ## Release Notes ### Fixes - Resources - _(prerelease fix)_ Fix resources with cocoapods integration (cherry picked from commit b884678)
@terrakok Testing with
|
Did you run "pod install" and reopen xcworkspace? |
My bad, forgot it, after a |
…dInstall" (#4900) By mistake the generation resources directory was linked to "podInstall" task instead "podspec". Fixes #4720 ## Testing - create a new Compose App project with an iOS integration via Cocoapods - add some multiplatform resources - clean all caches and build dirs - call "pod install" - check that first run of the iOS app works fine ## Release Notes ### Fixes - Resources - Create an empty resource dir with "podspec" task instead "podInstall"
A quick and effective workaround I discovered involves toggling the cocoapods {
summary = "Some description for the Shared Module"
homepage = "Link to the Shared Module homepage"
version = "1.0"
ios.deploymentTarget = "14.0"
podfile = project.file("../iosApp/Podfile")
framework {
baseName = "shared"
isStatic = true <-- toggle this, sync, then bring it back to its original state
} |
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks. |
Hello @terrakok! When I build Android, everything works as expected. However, iOS does crash due to missing resources.
This crash goes away if I close Xcode, run But this solution with My resources are in a separate module I started facing this issue when I upgraded from Kotlin 1.9.24 and CMP 1.6.11. I used to have a script in Build Phase to copy resources, and it worked just fine. But I removed this script as I suppose multimodule support is now available since 2.0, and it became redundant. Is there something I might have missed during migration? |
@tamimattafi I believe I have a sample with similar setup. Check it if you can run iosApp by following this instructions. |
Could you share a reproducer project on the youtrack, please? |
@GuilhE Thank you for the sample. I tried to reproduce the crash, but it doesn't happen, even If I run the project without the instructions. |
Describe the bug
I’m using compose 1.6.10-beta02 with
compose.components.resources
andcocoapods
to share the CMP module.androidApp
anddesktopApp
run fine, butiosApp
fails with:I’ve the same setup in another project and it works. It uses
XCFramework
could it be related?Affected platforms
Versions
2.0.0-RC1
1.6.10-beta02
14.4.1
arm64
simulator
To Reproduce
Steps and/or the code snippet to reproduce the behavior:
iosApp
via AndroidStudio or Xcode (trying to render previews will fail)Expected behavior
Run without problems like on
android
anddesktop
Screenshots
![Screenshot 2024-04-27 at 14 45 09](https://private-user-images.githubusercontent.com/2677139/326216298-2e21d721-f622-4adb-8ad9-870245d111f8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MzIzOTIsIm5iZiI6MTczOTYzMjA5MiwicGF0aCI6Ii8yNjc3MTM5LzMyNjIxNjI5OC0yZTIxZDcyMS1mNjIyLTRhZGItOGFkOS04NzAyNDVkMTExZjgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTVUMTUwODEyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MGMxN2NkYmZlYWVmNjEwY2IyOWIwODEyYzIwY2E0Y2UzZDJhOGY0ODQ1NGY1ZGY0ZDc2ZDU2M2RhY2VjZmRlOCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.ecVa5PwwJXxaOU_weif1WwMKuLdBdFD8OzMF08sOfA4)
Additional context
https://github.com/GuilhE/WhosNext has the same setup but uses
XCFramework
and it works with no problems.The text was updated successfully, but these errors were encountered: