-
Notifications
You must be signed in to change notification settings - Fork 122
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
Crash when using MR.strings() in unit tests iOS #714
Comments
hi. your tests in swift? not in kotlin? if yes - i think you should add build phase with copy resources to Tests Xcode target too |
Yes, my tests are in Swift. The thing is that I do not have Test target where I could add build phase. I have tests directly in the local SPM package (image below) |
@zvona031 looks like you should create special Plugin for run gradle task - https://github.com/apple/swift-package-manager/blob/main/Documentation/Plugins.md or you can change you module type from staticLibrary to dynamic |
Since I have never used Swift package build plugins, it is a bit confusing to me. Have you ever done something similar yourself? |
@zvona031 no |
Out of curiosity, how are the resources even working when I build my app, since I have static library and am not running any scripts for copying the resources. I am having a monorepo (shared, Android and iOS app), is that effecting this somehow? |
@zvona031 to works with static library in xcode should be added build phase that described in readme |
I saw that, but I did not add anything to my build phase, and it still works somehow. I am importing the shared code with SPM which is built using the KMMBridge. |
Hi, I have the same issue. On the project we use SPM and we have a monorepo as well, but the differences are dynamic framework as opposed to static and we have the build phase. The tests look okay, MR strings are being suggested by autocomplete in Xcode, but they crash in runtime, seems the MR class is not found |
Is it possible to get some help or advice regarding this issue? |
@zvona031 you can try my solution for SwiftUI previews - #747 (comment) |
I modularized my app with local SPM and I am trying to create tests for each module. But after running the test where I use
MR.strings()......
I get the following crashAt the end of the error it says: Caused by: kotlin.IllegalArgumentException: bundle with identifier org.undabot.inventory.shared.main not found.
Is there any additional setup needed for the tests?
The text was updated successfully, but these errors were encountered: