KMMBridge icon indicating copy to clipboard operation
KMMBridge copied to clipboard

Bundling resources with Swift Package

Open surajsau opened this issue 3 years ago • 5 comments

Trying to publish a module with shared string resource over moko-resources. Internally moko-resources generates Resource files for iOS. However, upon running on device it throws Uncaught Kotlin exception: kotlin.IllegalArgumentException: bundle with identifier xx.xx.MR not found.

Moko resources suggest adding a command to copy over resources in build phase.

Would be nice to add resources field also added in Package.swift when doing spmDevBuild (Bundling resources with Swift Package)

surajsau avatar Oct 19 '22 06:10 surajsau

Is this an issue just for local builds with spmDevBuild, or also for binary builds? Can toggling between static and dynamic frameworks help?

russhwolf avatar Nov 08 '22 13:11 russhwolf

I haven't tried it on binary builds but the issue was there for spmDevBuild.

surajsau avatar Nov 09 '22 04:11 surajsau

We have other priorities at the moment so probably won't get to this soon. But it should be possible to grab the updatePackageSwift task, call doLast {} or similar, and make edits manually.

russhwolf avatar Jan 23 '23 16:01 russhwolf

Just to be clear here, I think all that needs to happen is that there needs to be a way to bundle some resource files into the generated package. The command that copies them over in a monorepo build is just copying the contents of a directory into the target. That consists of some .lproj directories with Strings files, an Assests.xcassets directory and a files directory

dalewking avatar Oct 18 '23 16:10 dalewking