Closed checoalejandro closed 4 months ago
As stated in the Docs, multimodule resources are not supported yet. You can also check that in the actual code, which always references NSBundle.mainBundle
, so it means the current Gradle plugin implementation copies all resources to the app directly, no matter the Kotlin library is built as a static library or a dynamic library.
In theory, static frameworks can't have resources (they're not represented as an NSBundle
), so you have to export your library as a dynamic framework.
Compose gradle plugin doesn't support publication native frameworks as SPM or other packages. @paxbun is absolutely right. you may get resources manually from the build and do what you want, as workaround now
I am able to get the bundle of resources when integrating mocko-resources along with its compose implementation. I will continue testing and if it works as expected, I will detail the process to make this XCFramework to contain resources.
I am able to get the bundle of resources when integrating mocko-resources along with its compose implementation. I will continue testing and if it works as expected, I will detail the process to make this XCFramework to contain resources.
Hi! could you please share some details?
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Describe the bug When using compose-resources in a multiplatform project for iOS and Android and exported as an SPM with multiplatform-swiftpackage, when attempting to use resources in /files directory, the following error is thrown:
Cause: org.jetbrains.compose.resources.MissingResourceException: Missing resource with path: files/demo/majel.html
This error is not happening when using library as a pod.
Affected platforms
Versions
To Reproduce Steps and/or the code snippet to reproduce the behavior:
createSwiftPackage
task. This gets generated inswiftpackage
directory.Expected behavior SPM must contain the resources in Package.swift file and inside the XCFramework, resources directory must be created and included files.
Additional context Is there any workaround to force the inclusion of these resources manually? This looks to me more of a dependency on multiplatform-swiftpackage but need details on what to do to make it included.