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

unable to find bundle named Fakery_Fakery #153

Open
grutts opened this issue Nov 29, 2022 · 5 comments
Open

unable to find bundle named Fakery_Fakery #153

grutts opened this issue Nov 29, 2022 · 5 comments

Comments

@grutts
Copy link

grutts commented Nov 29, 2022

Hi,

We have an Xcode project using Fakery (via Swift Package Manager). We define factories using Fakery in the app, and these are used in the unit tests. Now, we wanted to add these factories using Fakery to the UI test target.

We've linked the Fakery binary to the UI tests (Build Phases -> Link Binary with Libraries), but when we try to run the tests we get this error

Fatal error: unable to find bundle named Fakery_Fakery in resource_bundle_accessor.swift

I'm conscious this could be a setup issue on our end, but we can't figure it out. Could this be a bug or a limitation in how the library can be used?

Thanks in advance.

Fakery 5.1.0
Xcode 13.4.1

@jdelaune
Copy link

Did you ever find a solution to this?

@kepstein
Copy link

I'm a Xcode newb, and I have the same issue. I figure it has to do with dependencies but haven't been able to figure out what's wrong.

@Uncommon
Copy link

Uncommon commented Jul 25, 2023

I'm having this issue too. Code in resource_bundle_accessor.swift is explicitly looking for a bundle named "Fakery_Fakery", but it's not clear to me why (or where) that bundle should exist.

@Uncommon
Copy link

It turns out this is a general problem with Swift Package Manager and nested frameworks. The resoure_bundle_accessor.swift file is auto-generated by SPM, and it doesn't handle nested frameworks correctly.

@Uncommon
Copy link

Uncommon commented Dec 7, 2023

I finally found a workaround for this: in the Xcode scheme editor, set the environment variable PACKAGE_RESOURCE_BUNDLE_PATH to $(CONFIGURATION_BUILD_DIR). In older version of Xcode it's PACKAGE_RESOURCE_BUNDLE_URL.

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

4 participants