title: dyld: Library not loaded: @rpath/libswiftAVFoundation.dylib Reason: image not found
body: <p>I'm getting this error upon launch of my app.  I am building under Xcode 9.0 (9A235) on MacOS High Sierra 10.13.  I also tried building under Xcode 8.3.3 with the same result.  The project is generally Objective C, but the framework YouAppi.framework is Swift:</p>
  
  <pre><code>dyld: Library not loaded: @rpath/libswiftAVFoundation.dylib
    Referenced from: /private/var/containers/Bundle/Application/7D3E2815-4CA3-4258-AEF6-C0626055A8F2/dingbats.app/Frameworks/YouAppi.framework/YouAppi
    Reason: image not found
  </code></pre>
  
  <p>At first glance, this appears to be a duplicate of <a href="https://stackoverflow.com/questions/32771796/dyld-library-not-loaded-rpath-libswiftavfoundation-dylib">this question</a>, but the error is different in that one.  In that other question, the Reason is <strong>no suitable image found</strong>, where mine is <strong>image not found</strong>.</p>
  
  <p>I've tried the following to resolve:</p>
  
  <ol>
  <li>Remove and re-add the framework</li>
  <li>Clean and Option+Clean the project</li>
  <li>Delete ~/Library/Developer/Xcode/DerivedData folder</li>
  <li>Build Settings -> Always Embed Swift Standard Libraries = Yes</li>
  <li>Build Settings -> Strip Swift Symbols = No</li>
  <li>Build Settings -> Linking -> Runpath Search Paths -- 
  
  <ul>
  <li>added @loader_path</li>
  <li>added @rpath</li>
  <li>added @executable_path/Frameworks</li>
  </ul></li>
  <li>Checked developer and distribution certificates that Trust was set to Use System Defaults</li>
  <li>Checked that I have latest WWDR and G2 certificates installed</li>
  <li>Checked validity of above-mentioned certificates</li>
  <li>Moved YouAppi.framework into Frameworks/ folder.  (It was originally in a "Third-Party Frameworks" folder.)</li>
  <li>Tried copying libswiftAVFoundation.dylib into my project's Frameworks folder</li>
  </ol>
  
  <p>I haven't moved to a new computer recently.</p>
  
  <p>I have the same result on my iPhone 7+ running iOS 11.0.23 (15A432) as well as an iPad Mini 1 running iOS 9.3.5 (13G36).</p>
  
  <p>Also tried this:</p>
  
  <pre><code>rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
  rm -rf ~/Library/Developer/Xcode/DerivedData
  rm -rf ~/Library/Caches/com.apple.dt.Xcode
  </code></pre>
  
  <p>Ideas?</p>