Reputation: 1044
Thanks for reading. Have been struggling with this all week, but no idea where to even start.
I have an ionic app which works on android with no problems, and works on iOS tablets with no problems, but won't run at all on iPhone. This is true for both simulators and real devices. This is a complete mystery to me. Its the same operating system!
This is the function which returns an error, in main.m. But I feel like this can't be problem, because if I edit the code here, it will just be rewritten next time I build from JavaScript. So the problem must be in my Ionic app. But then back to the original issue. Why iPhone and not iPad?
int main(int argc, char* argv[])
{
@autoreleasepool {
int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");
return retVal;
}
}
Anyway, can someone who knows a bit more about mobile and/or xcode please point me in the right direction here. I'm using the following versions:
cordova - 5.4.1
ionic - 1.7.13
xcode - 7.2
iOS:- 9.2, on iPad 2 and iPhone 6s
Thank you.
Upvotes: 1
Views: 2015
Reputation: 469
I had same problem, when i tried to start my ionic app on device. My emulation crashed by error for xcode. I use GoogleService-Info.plist for push notifications. I found the solution. While ionic building app, ionic erase my *-.plist file. I replaced *-.plist from root to platform/ios/${YOUR_APP_NAME}/Resources and to platform/ios/${YOUR_APP_NAME}/Resources/Resources and always work fine. I can build launch and publish my app for iphone devices. How i can see it very popular problem.
Upvotes: 0
Reputation: 1044
Managed to stumble upon the answer, although still a bit confused. Info.plist has a base controller for iPhone and for iPad. You can set them differently. iPad was blank (and working fine); iPhone had been set to MainController, or something along these lines.
Now they're both blank, and everything works fine. Moral of the story, I suppose, is to check your Info.plist.
Similar problem encountered (and solved) here: iPhone app works fine on iPad, but not on iPhone
Upvotes: 2