I am using Xcode11
I am getting following error, when I try to use a framework in a SampleAppSwift project:
dyld: Library not loaded: @rpath/VoiceSampler.framework/VoiceSampler
Referenced from: /private/var/containers/Bundle/Application/7ECB8715–2964–47B6–9F75–056F32846019/SampleAppSwift.app/SampleAppSwift
Reason: image not found
In the SampleAppSwift project, under Build Settings, I tried setting 'Always Embed Swift Standard Libraries' to YES. That did not help.
General->Frameworks, Library, and Embedded Content. If it's "Do Not Embed", change to "Embed Without Signing".
I had same problem. You should add a Copy File phase in your Build Phases as follows:
Under Build Phases, click on +
icon to add new phase, and select New Copy Files Phase
.
Drag the newly created Copy Files phase above Compile Sources
phase
In the new Copy Files phase, select Frameworks
for Destination
drop down.
Leave subpath
blank. Let be default Copy only when installing
.
Under the table, click '+' and then select your Framework, i.e. VoiceSampler.framework
Make sure Code Sign on Copy
is checked (ticked).
Do a clean build.
There is another simpler solution which worked for me if you are using Cocoapods.
In your Podfile, add use_frameworks! after your Target line like this -
target 'YourAppName' do
use_frameworks!
Basically it adds all your pods as a framework in your framework folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With