title: XCode9: code signing blocked mmap() while running on device
body: <p>I encountered the following issue after upgrading to XCode9 (Well I could not completely isolate the cause because I re-generated the certificate right after upgrading for enabling Push Service) :</p>
  
  <pre><code>dyld: Library not loaded: @rpath/apowo.framework/apowo
    Referenced from: /var/containers/Bundle/Application/2CD5CA32-1DAF-423B-B921-024DCBEE2AF0/picatown.app/picatown
    Reason: no suitable image found.  Did find:
      /private/var/containers/Bundle/Application/2CD5CA32-1DAF-423B-B921-024DCBEE2AF0/XXXX.app/Frameworks/apowo.framework/apowo: code signing blocked mmap() of '/private/var/containers/Bundle/Application/2CD5CA32-1DAF-423B-B921-024DCBEE2AF0/XXXX.app/Frameworks/apowo.framework/apowo'
  </code></pre>
  
  <p>There are several similar posts over SO but I believe it might be caused by something new. In fact the original issue was not on XXX.framework but libswiftcore, and after I have done all the suggestions on SO the error came from my own libraries. And here is what I have tried:</p>
  
  <ul>
  <li>clean</li>
  <li>delete the derived data</li>
  <li>restart XCode, Mac, and my phone</li>
  <li>delete all the certificates and recreate again</li>
  <li>delete the framework references (and the binaries as well) from the project and re-add</li>
  </ul>
  
  <p>None of them works.</p>
  
  <p>Some additional data is I am using jenkins and fastlane to manage the build. The XCode project is re-created every time when the job runs. The same job runs well on another machine which is on XCode 8 and nothing breaks (runs after re-creation of the certs so it is with the new certs).</p>
  
  <p>I thought it was about the libraries and I rebuilt them on XCode 9. The newly built libs were also in the XCode 8 built app and worked well but not on XCode 9.</p>
  
  <p>Any help will be appreciated.</p>