Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XCode9: code signing blocked mmap() while running on device

Tags:

xcode9

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) :

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'

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:

  • clean
  • delete the derived data
  • restart XCode, Mac, and my phone
  • delete all the certificates and recreate again
  • delete the framework references (and the binaries as well) from the project and re-add

None of them works.

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).

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.

Any help will be appreciated.

like image 737
YANG Lei Avatar asked Sep 27 '17 12:09

YANG Lei


Video Answer


2 Answers

I have tried the following step and it's working:
In XCode -> Build Phase -> Linked frameworks and libraries: choose your particular framework status from required to optional.

And it should work ;)

like image 102
shadow24 Avatar answered Jan 07 '23 19:01

shadow24


I was having a very similar issue which ended up being a coding signing / Certificating issue. This article goes over two possible solutions in depth. For me, it came down to changing my Developer Certificate's trust levels.

Open Keychain Access: My Certificates > "Right Click" Certificate > get info > Trust > When using this certificates > Use System Defaults

"When using this certificates" should go from Use Custom Settings > Use System Defaults

https://blog.supereasyapps.com/how-to-fix-iphone-and-ipad-app-codesign-crashes-using-an-apple-developer-profile/

like image 30
SamsonTheBrave Avatar answered Jan 07 '23 17:01

SamsonTheBrave