Can't run app on device: iOS 9 frameworks won't codesign

流过昼夜 提交于 2019-12-10 16:16:17

问题


I'm updating an app with deployment target iOS 7 so it can work with iOS 9. Also, I'm adding some cool iOS 8 and 9 features. I've read a lot of article about backwards version compatibility and now that Swift 2.0 makes it easier. The things I've taken care of so far are:

  • Having the Base SDK set at iOS 9 and the deployment target set at version 7
  • Checking the version at runtime with if #available(iOS 9.0, *) when using the new APIs
  • Linking the only-iOS9 frameworks optionally, as seen here:

As you can see the two new frameworks I'm using are ContactsUI and CoreSpotlight. When I run the app in the simulator it works perfectly, but when I try to build and run it on my device (which is running iOS 9 obviously) I get the following code signing error:

/path/to/a/file.framework: bundle format unrecognized, invalid, or unsuitable
Command /usr/bin/codesign failed with exit code 1

This error appears twice, for both the ContactsUI framework and the CoreSpotlight.

At first I thought that was a compatibility issue as it appeared for the first time when I tried to run my app on a iOS 7 device (to check it ran correctly), but then the same happened with my regular and up-to-date device.

Which is the issue here? Does the code signing error have to do with the compatibility of the frameworks? And, finally, when this is solved, will my app run on all the versions I want to support?

Thanks in advance, if you need more details just comment.


回答1:


I fixed the issue by just removing the frameworks from the Embedded Binaries list. Now I have all my frameworks only in the Linked Frameworks And Libraries list:




回答2:


Suggest you to follow these steps

Exit your xcode, Clear the derived data folder, Open xcode, Do a clean of your project folder, re-execute the build on device



来源:https://stackoverflow.com/questions/32342784/cant-run-app-on-device-ios-9-frameworks-wont-codesign

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!