0

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!

Craig
  • 358
  • 1
  • 9
  • I feel you're pain, but the way forward on something like this is not SO. Instead, you must find a way to reproduce the problem. (best candidate: early network requests... try forcing them to fail or to complete with unusually fast or slow times). – danh Jul 22 '14 at 15:01
  • I've tried that. This is why I'm thinking it's code signing or provisioning -- it's happening before launch really happens – Craig Jul 22 '14 at 16:49

3 Answers3

2

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.

super
  • 411
  • 3
  • 16
1

It can't be a codeSigning issue since its getting installed properly, Are you performing any server requests in your didFinishLaunching or have you linked up some static Libraries they might be the reason for this issue, what ever be it, its occurring right from your AppDelegate within didFininshLaunchingWithOptions method

Geet
  • 2,427
  • 2
  • 21
  • 39
  • Found out this morning it was that I was trying to read the bundle version and it wasn't set yet. This answer is correct; my initial assumptions were wrong. – Craig Jul 23 '14 at 16:10
1

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.

SaiyanGirl
  • 16,376
  • 11
  • 41
  • 57