简体   繁体   English

在启动完成之前,企业分布式iOS应用程序崩溃不一致

[英]Enterprise Distributed iOS App Crashes Inconsistently Before Launch Finishes

I'm distributing an iPhone application with the Enterprise Program. 我正在使用企业版程序分发iPhone应用程序。 Users download the app from a private location, and haven't reported any issues getting it installed. 用户从一个私有位置下载该应用程序,并且尚未报告安装该应用程序的任何问题。 The app runs fine for most people. 该应用对于大多数人来说运行良好。

However, some users complain that the app crashes before it finishes launching (they tap the icon, it zooms in to launch, and then immediately returns to the home screen). 但是,一些用户抱怨该应用在启动完成之前崩溃(他们点击该图标,它会放大以启动,然后立即返回主屏幕)。 I've observed this in person on a couple of occasions. 我已经亲自观察了几次。 Deleting the app and reinstalling it does not correct the issue for most people. 对于大多数人来说,删除该应用程序并重新安装它并不能解决问题。

This problem occurred on my own device once, but deleting and reinstalling the app corrected it in my case. 此问题曾在我自己的设备上发生过一次,但是在我的情况下,删除并重新安装该应用程序可以解决此问题。 No logs are left on the device referencing the issue. 在设备上没有日志引用该问题。

At first, I was thinking the application:didFinishLaunchingWithOptions: was taking too long and preventing the application from loading properly, but I took all of the potentially blocking code out of that method, and backgrounded it with no effect. 最初,我以为application:didFinishLaunchingWithOptions:花费的时间太长,导致应用程序无法正确加载,但是我从该方法中删除了所有可能阻塞的代码,并使其后台无效。

I suspected it was a codesigning issue, so I rebuilt and provided a new copy with a new provisioning profile. 我怀疑这是一个代码签名问题,因此我重新构建并提供了具有新配置文件的新副本。 This, too, had no effect. 这也没有效果。

Considering there are no logs (either reported by Google Analytics or directly on the devices), I am under the impression that the app is not starting at all, and that this is a problem with the way the application has been prepared. 考虑到没有日志(由Google Analytics(分析)报告或直接在设备上记录),我的印象是该应用程序根本没有启动,这与应用程序的准备方式有关。

Any insight would be appreciated! 任何见识将不胜感激!

I have experienced something like this. 我经历过这样的事情。

After this was driving me crazy, I realized where the error was changing the scheme for the Run action on Xcode. 在这使我发疯之后,我意识到了错误正在更改Xcode上的Run操作的方案。

Switching the configuration to "Release" got me to launch the application on the device in the exact same conditions as it is when released for entrerprise or ad-hoc version. 将配置切换为“发布”使我可以在与企业版或临时版发布时完全相同的条件下在设备上启动应用程序。

At the point of crash I was able to get the exact line of code and solved the problem. 在崩溃点,我能够获得确切的代码行并解决了问题。

自正确安装以来,这不会是codeSigning问题,您是否在didFinishLaunching中执行任何服务器请求,或者是否已链接了一些静态库,它们可能是导致此问题的原因,无论是什么,它都是直接从您发生的didFininshLaunchingWithOptions方法中的AppDelegate

I've noticed this started happening with all of my iOS 8+ devices, but none with iOS 7 or 6. The problem was indeed with the code signing. 我注意到所有iOS 8+设备都开始发生这种情况,但iOS 7或6都没有发生这种情况。问题确实出在代码签名上。 First of all, I needed to add an Entitlements.plist file to the code signing (I codesign using the command line). 首先,我需要在代码签名中添加一个Entitlements.plist文件(我使用命令行进行代码签名)。 Without an entitlements file, the application wouldn't install on any of my devices. 没有授权文件,该应用程序将无法安装在我的任何设备上。 However, with the entitlements file, it would crash on iOS8+. 但是,使用授权文件,它将在iOS8 +上崩溃。 I believe the error was that I was creating an automatic Entitlements file using C# on Windows. 我相信错误是我在Windows上使用C#创建了自动权利文件。 Windows adds some line endings that Apple doesn't agree with. Windows添加了一些苹果公司不同意的行尾。 The solution was to use an entitlements file created on a Mac. 解决方案是使用在Mac上创建的权利文件。

As a side note, ensure that the bundle ID on the entitlements file matches the one from the provisioning profile used to sign the app. 另外,请确保权利文件上的捆绑包ID与用于对应用程序进行签名的供应配置文件中的ID匹配。

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

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