Skip to content
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

Resources not being copied to iOS app bundle #792

Open
griffinsorrentino opened this issue Dec 10, 2024 · 1 comment
Open

Resources not being copied to iOS app bundle #792

griffinsorrentino opened this issue Dec 10, 2024 · 1 comment

Comments

@griffinsorrentino
Copy link

griffinsorrentino commented Dec 10, 2024

Likely caused by the changes made in #786

*.bundle files are not being copied into the *.app bundle when compiling (and running) x:copy<x>FrameworkResourcesToApp

I believe this is specific only when using Kotlin 2.1 due to the new unpacked klibs (as mentioned in the other bug report)

As a workaround, modify the moko resources Xcode build phase to manually run a shell script which copies these files instead of using the gradle task

@griffinsorrentino
Copy link
Author

@Alex009 Looks like a few other issues are possibly linked to this, #796 and #793? Any chance this can get looked at?

For others experiencing a runtime crash due to missing resources, you can replace the x:copy<x>FrameworkResourcesToApp build phase in xcode with custom copy logic like shown below:

rm -r "$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/*.bundle"

cp -r -p $(find "$SRCROOT/../<path to resources module>" -name '<app name>*.bundle') "$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH"

Be sure to be specify the correct base directory for the module that contains your resource files, a lot of libraries have other .bundle files that could exist within your build directories of other modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant