title: dyld: Library not loaded: code signature invalid
body: <p>I'm trying to build and run an application that uses the AVFoundation framework ...</p>
  <p><em>( I know that this is duplicate, but the solutions posted elsewhere doesn't help me.)</em></p>
  <p>I build successfully but the app crashes when I re-run it from Xcode with the following error:</p>
  <pre><code>&gt; 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:
  
  &gt;code signature invalid for '/private/var/containers/Bundle/Application/B9B93BB2-F55E-4DAE-A720-0F2D22A47278/FaceMarks.app/Frameworks/libswiftAVfoundation.dylib'
  
  &gt; lldb
  </code></pre>
  <p>The complete error message :</p>
  <p><a href="https://i.stack.imgur.com/91M3U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/91M3U.png" alt="enter image description here" /></a></p>
  <p>I have found many solutions, I have tested many of them but all of those not worked for me:</p>
  <blockquote>
  <ol>
  <li>Clean, build and run an application</li>
  </ol>
  </blockquote>
  <blockquote>
  <ol start="2">
  <li>Set &quot;Always Embed Swift Standard Libraries&quot; to &quot;Yes&quot; under the Build Settings &gt; Build Options</li>
  </ol>
  </blockquote>
  <blockquote>
  <ol start="3">
  <li>Restart Xcode</li>
  </ol>
  </blockquote>
  <blockquote>
  <ol start="4">
  <li>Restart the phone</li>
  </ol>
  </blockquote>
  <blockquote>
  <ol start="5">
  <li>Reinstall the Xcode</li>
  </ol>
  </blockquote>
  <blockquote>
  <ol start="6">
  <li>Testing other simple application on my iPhone ( App contains just a print function )</li>
  </ol>
  </blockquote>
  <blockquote>
  <p>Note: <strong>That the test app works fine on the simulator but on my iPhone it gives the same error</strong></p>
  </blockquote>
  <p>dyld: <strong>Library not loaded: @rpath/libswiftCore.dylib</strong></p>
  <p><a href="https://i.stack.imgur.com/JcICE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JcICE.png" alt="enter image description here" /></a></p>