SwiftUI Preview not finding image of used framework
Asked Answered
C

0

6

My project consists of a main iOS app project and three additional frameworks for Presentation, Domain and Data layers. My own frameworks are embedded in the main target. Third party frameworks are managed by CocoaPods and linked dynamically.

Now if I try to preview my code I get the following error:

RemoteHumanReadableError: Failed to update preview.

Error encountered when sending 'previewInstances' message to agent.

==================================

|  RemoteHumanReadableError
|  
|  LoadingError: failed to load library at path "/Users/lucas/Library/Developer/Xcode/DerivedData/Envim-grqjeyyonytbnxcujdcadldmkoni/Build/Intermediates.noindex/Previews/Envim (iOS)/Products/Debug-iphonesimulator/Presentation.framework/Presentation": Optional(dlopen(/Users/lucas/Library/Developer/Xcode/DerivedData/Envim-grqjeyyonytbnxcujdcadldmkoni/Build/Intermediates.noindex/Previews/Envim (iOS)/Products/Debug-iphonesimulator/Presentation.framework/Presentation, 0): Library not loaded: @rpath/Resolver.framework/Resolver
|    Referenced from: /Users/lucas/Library/Developer/Xcode/DerivedData/Envim-grqjeyyonytbnxcujdcadldmkoni/Build/Intermediates.noindex/Previews/Envim (iOS)/Products/Debug-iphonesimulator/Presentation.framework/Presentation
|    Reason: image not found)

I hope I included all relevant information. In case I forgot something feel free to request it.

Cobaltite answered 8/2, 2021 at 17:33 Comment(6)
Have you found a solution for this? If so can you post it?Saloma
Same issue here. Any solution?Imminent
@Imminent sorry I'm not sure whether I fixed it or whether I just restructured my project. I looked up my git history and I think that I fixed it by editing the search paths in Build Settings > Linking > Runpath Search Paths and entered the following three values $(inherited) @executable_path/Frameworks @loader_path/Frameworks Would be great if you could test these changes, then I could create an official answer.Cobaltite
Unfortunately those are also my path settings and it's still outputting the error you have in your original question.Imminent
@Imminent I don't think that I changed anything else then. But here's my Podfile maybe this helps you out gist.github.com/the-blaggyS/b97467b7c966886b6d373dbb800bede6Cobaltite
Interesting, I'll take a look. In any case thanks for your quick repliesImminent

© 2022 - 2024 — McMap. All rights reserved.