简体   繁体   中英

Enterprise Distributed iOS App Crashes Inconsistently Before Launch Finishes

I'm distributing an iPhone application with the Enterprise Program. 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.

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.

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.

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. First of all, I needed to add an Entitlements.plist file to the code signing (I codesign using the command line). Without an entitlements file, the application wouldn't install on any of my devices. However, with the entitlements file, it would crash on iOS8+. I believe the error was that I was creating an automatic Entitlements file using C# on Windows. Windows adds some line endings that Apple doesn't agree with. The solution was to use an entitlements file created on a 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.

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