Reputation:
I'm trying to build and run an application that uses the AVFoundation framework ...
( I know that this is duplicate, but the solutions posted elsewhere doesn't help me.)
I build successfully but the app crashes when I re-run it from Xcode with the following error:
> dyld: Library not loaded: @rpath/libswiftAVFoundation.dylib
Referenced from : /private/var/containers/Bundle/Application/B9B93BB2-F55E-4DAE-A720-0F2D22A47278/FaceMarks.app/FaceMarks
Reason: no suitable image found. Did find:
/private/var/containers/Bundle/Application/B9B93BB2-F55E-4DAE-A720-0F2D22A47278/FaceMarks.app/Frameworks/libswiftAVfoundation.dylib:
>code signature invalid for '/private/var/containers/Bundle/Application/B9B93BB2-F55E-4DAE-A720-0F2D22A47278/FaceMarks.app/Frameworks/libswiftAVfoundation.dylib'
> lldb
The complete error message :
I have found many solutions, I have tested many of them but all of those not worked for me:
- Clean, build and run an application
- Set "Always Embed Swift Standard Libraries" to "Yes" under the Build Settings > Build Options
- Restart Xcode
- Restart the phone
- Reinstall the Xcode
- Testing other simple application on my iPhone ( App contains just a print function )
Note: That the test app works fine on the simulator but on my iPhone it gives the same error
dyld: Library not loaded: @rpath/libswiftCore.dylib
Upvotes: 0
Views: 5392
Reputation: 1258
Are you using the -deep
signing flag? It can cause this problem.
See "--deep
Considered Harmful".
Upvotes: 0
Reputation: 660
Even with the paid developer account, I had to include the $(inherited) in the linker flags at the top. This actually did the trick. Secondly, I started having this issue in the release enterprise build, the reason was the certificate was not trusted to I had to add the Certificate Authority relevant to that certificate to make it valid.
Upvotes: 0
Reputation: 3613
For all those still looking for a solution, I have a free dev account and solved it like this:
The problem is that you must first "trust" your account on your iPhone, and trust apps made from this developer.
See instruction with screenshots here: https://entirefaq.helpdocs.com/mobile-apps/iphone-app-how-to-fix-the-untrusted-enterprise-developer#:~:text=Tap%20Settings%20%3E%20General%20%3E%20Profiles%20or,prompt%20to%20confirm%20your%20choice.
Upvotes: 0
Reputation: 2543
Code signing issues are usually account related, so if you're using a free Apple dev account that carries certain limitations and expiration issues with it.
Firstly, make sure you have a valid and active developer account logged into Xcode under:
Xcode | Preferences | Accounts
Alternatively remove the developer account shown there and add it back in again.
Secondly make sure that the account specified under Preferences | Accounts matches what you have selected for your project target under:
<TargetName> | Signing & Capabilities
Upvotes: 2