简体   繁体   English

应用程序在运行已存档的导出的.ipa时崩溃,但可在模拟器上运行并将其侧面加载到设备上

[英]App crashes while running the archived exported .ipa but works on simulator and side loading the app onto device

I'm currently using Xcode 7 Beta 6 and the app works on the simulator and the device when I deploy directly using my developer's certificate. 我目前正在使用Xcode 7 Beta 6,当我直接使用开发人员的证书进行部署时,该应用程序可以在模拟器和设备上运行。 However, when I try to create an IPA file using the Archive feature, the app is not able to launch from the device. 但是,当我尝试使用存档功能创建IPA文件时,该应用程序无法从设备启动。 It's crashing and complaining that the custom frameworks are not loaded / no suitable image found. 崩溃并抱怨自定义框架未加载/找不到合适的映像。 The following is a screenshot from the crash log [removed some unnecessary information]: 以下是崩溃日志中的屏幕截图[已删除了一些不必要的信息]:

在此处输入图片说明

I tried archiving with the enterprise certificate and the developer's certificate and both give the same issue. 我尝试使用企业证书和开发人员的证书进行归档,并且都给出了相同的问题。 Can someone help? 有人可以帮忙吗? I tried several suggested solutions from online forums but they didn't work for me: 我从在线论坛上尝试了几种建议的解决方案,但它们对我不起作用:

  • Added the custom frameworks to embedded Binaries and link binaries with libraries 将自定义框架添加到嵌入式Binaries并将Binaries与库链接
  • The build phase also copies the frameworks to the frameworks folder 构建阶段还将框架复制到frameworks文件夹
  • Checked on the framework search path 检查框架搜索路径
  • Tried installing on iPhone 5 rather than iPhone 6+ and the same issue occurs 尝试在iPhone 5而不是iPhone 6+上安装,并且出现相同的问题
  • Checked on the architecture of the frameworks on command line 在命令行上检查框架的架构
  • The frameworks are also packaged in the IPA 这些框架也打包在IPA中
  • Tried creating a simple Hello World app and generated the IPA successfully. 尝试创建一个简单的Hello World应用并成功生成IPA。 The app launches on the device with the enterprise profile, so this tells me that the certs are working. 该应用程序将在具有企业资料的设备上启动,因此这告诉我证书正在运行。

Further thing to note is that there are no entitlements associated with the custom frameworks when I export the Archive on the Organizer tool. 还要注意的一点是,当我导出“组织器”工具上的存档时,没有与自定义框架相关的权利。 I am not sure if we are supposed to have any. 我不确定我们是否应该有。 Here is a screenshot of similar issue without the entitlements for the libraries: https://drive.google.com/file/d/0B68-3G8aSUUHdjZWdjJrcHZEVEU/view 这是类似问题的屏幕快照,没有库的权利: https : //drive.google.com/file/d/0B68-3G8aSUUHdjZWdjJrcHZE​​VEU/view

In general, it's working when I side load the app via developer's cert so I don't know why the archive may behave differently. 通常,当我通过开发人员的证书侧加载应用程序时,它可以正常工作,因此我不知道为什么存档的行为可能有所不同。

Other solutions for possible similar issue that I tried but no avail. 我尝试过但无法解决可能出现的类似问题的其他解决方案。

I found the solution to the issue! 我找到了解决问题的方法! Hope this helps anyone facing the same issue. 希望这可以帮助面临相同问题的任何人。 To correct this problem, you will need to sign your app using code signing certificates with the Subject Organizational Unit (OU) set to your Team ID. 若要更正此问题,您将需要使用主题组织单位(OU)设置为团队ID的代码签名证书对应用程序进行签名。 Apple has made a change to their certificates so we needed to re-create the new certificate for signing our app. 苹果对证书进行了更改,因此我们需要重新创建新证书以对我们的应用进行签名。

Steps are as follows to fix the certificate issue: 请按照以下步骤解决证书问题:

  1. Revoke the distribution/developer certificate 撤销发行/开发人员证书
  2. Create a new distribution/developer certificate 创建一个新的发行/开发人员证书
  3. Update the corresponding profile with your newly created certificate 使用您新创建的证书更新相应的配置文件
  4. Archive your app again with the new certificate 使用新证书再次存档您的应用

Last but not least, the app schema should already contain the embedded frameworks if any, so no additional changes were required other than specifying the proper bundle ID, Team name, and code signing identity. 最后但并非最不重要的一点是,应用程序架构应该已经包含嵌入式框架(如果有的话),因此除了指定正确的捆绑软件ID,团队名称和代码签名身份之外,无需进行其他更改。

The solution provided in this Q&A helped me achieve this solution: Apple's Technical Q&A 本问答中提供的解决方案帮助我实现了以下解决方案: Apple的技术问答

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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