简体   繁体   中英

iOS App Enterprise Deployment: Provisioning Profile for Libraries

We are currently trying to deploy a new version of an iOS Enterprise App via Mobile Device Management after some changes in architecture.

The same app has succesfully been deployed a couple of times in the past, but we recently added a library to the app (in order to reuse some of our code in different places).

The app runs fine when started from Debugger, but crashes immediatly after start when signed and deployed via Mobile Device Management. iOS Crashlog reveals that the library we added does exist but is not loaded.

The error message reads:

Dyld Error Message:
Library not loaded: @rpath/MYAPPLib.framework/MYAPPLib
Referenced from: /private/var/mobile/Containers/Bundle/Application/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/MYAPP_iOS.app/MYAPP_iOS
Reason: no suitable image found.  Did find:

/private/var/mobile/Containers/Bundle/Application/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/MYAPP_iOS.app/Frameworks/MYAPPLib.framework/MYAPPLib: mmap() error 1 at address=0xXXXXXXXX, size=0xXXXXXXXX segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/MYAPP_iOS.app/Frameworks/MYAPPLib.framework/MYAPPLib

(The bundle identifier and application name have been changed)

We suspect that this might be a signing issue. After archiving the product and exporting ("Save for Enterprise Deployment"), we noticed that no Provisioning Profile is selected for said library (see screenshot below) 从xcode导出过程的屏幕截图

Long story short, the question is: Is it necessary for a library in an iOS App to have a Provisioning Profile? If so, how can I assign one?

All right, so we are still not sure what exactly the problem was. But we can say that the error was resolved by issuing a new developer certificate . So if you are facing the same problem, maybe you want to try this as well.

From the console seems that the app does not find the framework file.

  1. Make sure in your Build Settings you set the Runpath Search Paths to @executable_path/Frameworks
  2. Make sure in Build Phases to have your Framework under Embed Frameworks.
  3. Add your framework under Link Binary With Libraries.

If your framework is developed under same project make sure you make sure you have it under Copy File under Build Phases.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM