-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Bug with test spec / static linkage / XCFramework - Failed to load the test bundle. The bundle is damaged or missing necessary resources. Library not loaded. Reason: image not found. #10652
Comments
Is there a solution? |
I haven't found one yet I'm afraid. I am hoping someone much wiser than me might be able to help 🤞 |
I could also reproduce this issue when having a |
@acecilia thanks, this is useful for others to know but I am unforrtunately not able to change the framework type output from a third party dependency. So I am still in need of help please 🙏 . |
this seems like a bug that the xcframeworks are not embedded to unit test targets or even in the app hosts if they specify one. The reason the screenshot you pasted above works is because that is a default search path that is being searched and so that works. |
Thanks for your input @dnkoutso In case its useful, the and the So I guess its the last two entries that are of interest. |
yeah I think I was a bit off in my initial statement, this is a runtime issue, basically the frameworks are not copied inside the test bundle as they should. |
I read the issue above a bit more, things can be a bit interesting because those are statically linked...I need to dig further. |
I took another look, yes it seems we are not embedding the frameworks that were produced by the xcframework into test bundles or their app hosts (if they have any). I continue to believe it works if you copy over the framework to the top level folder because its probably searched as a runpath to load frameworks from by default. It does not appear to be a header search paths issue per se, otherwise we would see compilation failures vs runtime dyld errors. |
More inspection this appears to be a bug actually. The embed frameworks script is being written but the unit test target does not get the phase added to it. |
Thanks for the updates @dnkoutso. Really appreciate your efforts looking into this 🙏 |
PR! #10830 @OliverPearmain-Triller thank you a lot for the great report and sample app, helped a lot! I verified it builds successfully with my change. |
Hello there.
I will try to reopen another issue as soon as I have a test project to attach |
Actually this is still open that describe the same issue |
Report
The unit tests (test spec) of a certain local/development pod fail at run time with the following error:
The error seems to manifest because:
The
Podfile
specifiesuse_frameworks! :linkage => :static
(if you change to
use_frameworks!
only, things work fine)The development pod/module has an XCFramework dependency (
Mux-Stats-AVPlayer
)(if you change
SomeModule
s dependency fromMux-Stats-AVPlayer
toRxSwift
, things work fine)Unfortunately I am not able to change either of these things in my reall-world project.
Workarounds tried and failed:
I have tried the following, as suggested in other threads, but the outcome is exactly the same...
test_spec.requires_app_host = true
"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES" => "YES"
What did you do?
pod install
DemoApp
scheme and run the tests(note that the
DemoApp
scheme hasSomeModule-Unit-Tests
included in it's test suite)What did you expect to happen?
✅
SomeModule-Unit-Tests
run and pass✅
DemoAppTests
run and passWhat happened instead?
❌
SomeModule-Unit-Tests
do not run. They encounter the run time error mentioned above.✅
DemoAppTests
run and passCocoaPods Environment
Stack
Installation Source
Plugins
Podfile
Project that demonstrates the issue
https://github.com/OliverPearmain/CocoapodsTestBundleIssueExample
The text was updated successfully, but these errors were encountered: