App wont load past splash screen on devices


#1

App works fine on browser and emulator, when i put it on testflight and test on a phone, or when apple reviews it, stays stuck on splash screen with the loading indicator on.

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.1
ionic (Ionic CLI) : 3.19.1

global packages:

cordova (Cordova CLI) : 7.1.0

local packages:

@ionic/app-scripts : 3.0.1
Cordova Platforms  : android 6.3.0 ios 4.5.4
Ionic Framework    : ionic-angular 3.8.0

System:

ios-deploy : 1.9.2
Node       : v6.11.3
npm        : 3.10.10
OS         : macOS High Sierra
Xcode      : Xcode 9.2 Build version 9C40b

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : pro


#2

Hi,

To help you debug the issue, I/we could really use some help like your:

full ionic info
list of ionic plugins
list of errors or missing info in your console.log

and if you can, (according to device), put us the error log of each of these:

ionic cordova run android -c
ionic cordova run ios -c

Thanks,

François


#3

Ionic Info:

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.1
ionic (Ionic CLI) : 3.19.1

global packages:

cordova (Cordova CLI) : 7.1.0 

local packages:

@ionic/app-scripts : 3.1.8
Cordova Platforms  : none
Ionic Framework    : ionic-angular 3.9.2

System:

ios-deploy : 1.9.2 
Node       : v6.11.3
npm        : 3.10.10 
OS         : macOS High Sierra
Xcode      : Xcode 9.2 Build version 9C40b 

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : pro

Ionic plugins

cordova-plugin-advanced-http 1.10.0 "Advanced HTTP plugin"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-googlemaps 2.2.4 "cordova-plugin-googlemaps"
cordova-plugin-inappbrowser 2.0.2 "InAppBrowser"
cordova-plugin-nativegeocoder 3.0.0 “NativeGeocoder”


#4

i just ran:

ionic doctor check
:heavy_check_mark: Detecting issues: 16 / 16 complete - done!
Detected 2 issues.
[WARN] Update available for Ionic Native.

   An update is available for Ionic Native (4.4.0 => 4.5.3). To fix, the following step(s) need to be taken:
   
        1) Run: npm i --save -E @ionic-native/core@4.5.3
        2) Run: npm i --save -E @ionic-native/geolocation@4.5.3
        3) Run: npm i --save -E @ionic-native/google-maps@4.5.3
        4) Run: npm i --save -E @ionic-native/http@4.5.3
        5) Run: npm i --save -E @ionic-native/in-app-browser@4.5.3
        6) Run: npm i --save -E @ionic-native/native-geocoder@4.5.3
        7) Run: npm i --save -E @ionic-native/splash-screen@4.5.3
        8) Run: npm i --save -E @ionic-native/status-bar@4.5.3

? Fix automatically? Yes

npm i --save -E @ionic-native/core@4.5.3
:heavy_check_mark: Running command - done!
npm i --save -E @ionic-native/geolocation@4.5.3
:heavy_check_mark: Running command - done!
npm i --save -E @ionic-native/google-maps@4.5.3
:heavy_check_mark: Running command - done!
npm i --save -E @ionic-native/http@4.5.3
:heavy_check_mark: Running command - done!
npm i --save -E @ionic-native/in-app-browser@4.5.3
:heavy_check_mark: Running command - done!
npm i --save -E @ionic-native/native-geocoder@4.5.3
:heavy_check_mark: Running command - done!
npm i --save -E @ionic-native/splash-screen@4.5.3
:heavy_check_mark: Running command - done!
npm i --save -E @ionic-native/status-bar@4.5.3
:heavy_check_mark: Running command - done!
[WARN] Cordova platforms unsaved.

   There are Cordova platforms installed that are not saved in config.xml or package.json. It is good practice to 
   manage Cordova platforms and their versions. See 
   https://cordova.apache.org/docs/en/latest/platform_plugin_versioning_ref/ for more information. To fix, the 
   following step(s) need to be taken:
   
        1) Run: ionic cordova platform save

? Fix automatically? Yes

ionic cordova platform save
cordova platform save
This command has been deprecated and will be removed in the next major release of cordova.

[OK] Fixed 2 issues!


#5

@cityfresno Thank you for the run tests. It seems you have a lot of native packages, native packages are not bad, but shouldn’t be too much in Ionic Apps. Because they tend to conflict each other. I’m still trying to figure out what cause your splash screen to crash, I assume it’s because you just upgraded Ionic version? (did you?)


#6

this was happening before i upgraded. And the weird part, only happens the first time it loads, after i force close, and open it, it loads fine. I’ve launched many other apps, and never this issue.

Here’s the xcode results:

2018-02-13 17:14:54.071927-0800 myFAXbus[5062:75894351] Apache Cordova native platform version 4.5.3 is starting.
2018-02-13 17:14:54.072159-0800 myFAXbus[5062:75894351] Multi-tasking -> Device: YES, App: YES
2018-02-13 17:14:54.104644-0800 myFAXbus[5062:75894351] CDVWKWebViewEngine: trying to inject XHR polyfill
2018-02-13 17:14:54.177108-0800 myFAXbus[5062:75894351] [MC] Lazy loading NSBundle MobileCoreServices.framework
2018-02-13 17:14:54.177885-0800 myFAXbus[5062:75894351] [MC] Loaded MobileCoreServices.framework
2018-02-13 17:14:54.181924-0800 myFAXbus[5062:75894351] CDVWKWebViewEngine will reload WKWebView if required on resume
2018-02-13 17:14:54.182034-0800 myFAXbus[5062:75894351] Using Ionic WKWebView
2018-02-13 17:14:54.182419-0800 myFAXbus[5062:75894351] [CDVTimer][console] 0.057936ms
2018-02-13 17:14:54.182614-0800 myFAXbus[5062:75894351] [CDVTimer][handleopenurl] 0.087023ms
2018-02-13 17:14:54.184334-0800 myFAXbus[5062:75894351] [CDVTimer][intentandnavigationfilter] 1.595020ms
2018-02-13 17:14:54.184491-0800 myFAXbus[5062:75894351] [CDVTimer][gesturehandler] 0.057936ms
2018-02-13 17:14:54.207518-0800 myFAXbus[5062:75894351] [CDVTimer][file] 22.904992ms
2018-02-13 17:14:54.230990-0800 myFAXbus[5062:75894351] [CDVTimer][splashscreen] 23.351073ms
2018-02-13 17:14:54.239248-0800 myFAXbus[5062:75894351] CDVIonicKeyboard: resize mode 1
2018-02-13 17:14:54.240457-0800 myFAXbus[5062:75894351] [CDVTimer][keyboard] 9.258986ms
2018-02-13 17:14:54.270303-0800 myFAXbus[5062:75894351] [CDVTimer][statusbar] 29.696941ms
2018-02-13 17:14:54.270444-0800 myFAXbus[5062:75894351] [CDVTimer][TotalPluginStartup] 88.106990ms
2018-02-13 17:14:57.338907-0800 myFAXbus[5062:75894351] Ionic Native: deviceready event fired after 936 ms
2018-02-13 17:14:57.366677-0800 myFAXbus[5062:75894351] CDVWKWebViewEngine: handleStopScroll
2018-02-13 17:14:57.635527-0800 myFAXbus[5062:75894544] [Warning] No NSLocationAlwaysUsageDescription or NSLocationWhenInUseUsageDescription key is defined in the Info.plist file.
2018-02-13 17:14:57.638043-0800 myFAXbus[5062:75894351] [Warning] No NSLocationAlwaysUsageDescription or NSLocationWhenInUseUsageDescription key is defined in the Info.plist file.
2018-02-13 17:14:57.867268-0800 myFAXbus[5062:75894544] [Warning] No NSLocationAlwaysUsageDescription or NSLocationWhenInUseUsageDescription key is defined in the Info.plist file.


#7

Still me François (freelancer on Ionic in Paris, France),

Thanks, finally the reports on iOS, it will give you more things to compile, to find out the bug.
You can also try to upgrade to the latest version of Ionic, but I doubt it will solve all issues. Still, it’s worth a test with a dev server for the city. (for another client i always have 2 servers running, dev and production).

Good luck


#8

@cityfresno And if you upgraded from a previous app, it’s sometimes better to delete platforms/ios from your project and rebuild it from scratch, because I had to do it in my own business app, while moving from Ionic 2 to Ionic 3. And it changed most of the routines of app.

Have fun with Ionic


#9

When you built your app did you do:

ionic cordova build iOS --prod --release

Also you need to enable production mode so you won’t use debug options in angular. go to your main.ts file and:

import {enableProdMode} from '@angular/core';

enableProdMode();

This should help you with loading times. I had issues on my android app. It was taking 16 seconds from splashing screen until the app showed up. The iOS version was fine.

also…

in your app.component.ts file, what is your rootpage variable pointing to? Example:

rootPage: any = HomePage;

#10

@mikrochipkid they are in prod mode for long, they are the company bus of a quite large city, just read above please…

For the rest and thus solution for the city of Fresno (because it’s hard remotely to debug), a good TS/JS freelancer seems a good counselor for the city, rather than plenty of people that have no idea of what they talk about.

Regards, François


#11

@FrancoisIonic It doesn’t matter if they were in production for a long time… by doing what I stated above. It reduces the amount of debug functions in production mode applications thus making your app response more quickly and it greatly reduces the size of you application. I’m not sure your aware of this but it is clearly stated in the Docs:

Also the application when it first loads may be having trouble looking for the rootPage so thats why I stated to check what Root page to have to be first initialized.

It doesn’t take a rocket scientist to debug an application either… he has common problems that other people has had in the past. So what worked for me may work for him.


#12

To build, it was done using ionic pro web version. Never had an issue there.

I do have production mode enabled, and my app.components.ts. If you want to test the app, msg me at apps@fresno.gov, and i’ll send you an invite code.


#13

I got it to run on xcode simulator fine, when i try and run on my iphone hangs on splash screen and this is the message: 2018-02-14 09:04:38.355920-0800 MyFAXbus[7256:3465438] [DYMTLInitPlatform] platform initialization successful
2018-02-14 09:04:38.529444-0800 MyFAXbus[7256:3465304] Apache Cordova native platform version 4.5.3 is starting.
2018-02-14 09:04:38.531313-0800 MyFAXbus[7256:3465304] Multi-tasking -> Device: YES, App: YES
2018-02-14 09:04:38.563776-0800 MyFAXbus[7256:3465304] CDVWKWebViewEngine: trying to inject XHR polyfill
2018-02-14 09:04:38.652444-0800 MyFAXbus[7256:3465304] [MC] Lazy loading NSBundle MobileCoreServices.framework
2018-02-14 09:04:38.653784-0800 MyFAXbus[7256:3465304] [MC] Loaded MobileCoreServices.framework
2018-02-14 09:04:38.659542-0800 MyFAXbus[7256:3465304] CDVWKWebViewEngine will reload WKWebView if required on resume
2018-02-14 09:04:38.659617-0800 MyFAXbus[7256:3465304] Using Ionic WKWebView
2018-02-14 09:04:38.659985-0800 MyFAXbus[7256:3465304] [CDVTimer][console] 0.069976ms
2018-02-14 09:04:38.660219-0800 MyFAXbus[7256:3465304] [CDVTimer][handleopenurl] 0.180960ms
2018-02-14 09:04:38.663137-0800 MyFAXbus[7256:3465304] Unlimited access to network resources
2018-02-14 09:04:38.663315-0800 MyFAXbus[7256:3465304] [CDVTimer][intentandnavigationfilter] 3.054976ms
2018-02-14 09:04:38.663461-0800 MyFAXbus[7256:3465304] [CDVTimer][gesturehandler] 0.108004ms
2018-02-14 09:04:38.665406-0800 MyFAXbus[7256:3465304] [CDVTimer][cordovagooglemaps] 1.903057ms
2018-02-14 09:04:38.667083-0800 MyFAXbus[7256:3465304] [CDVTimer][keyboard] 1.524925ms
2018-02-14 09:04:38.706140-0800 MyFAXbus[7256:3465304] [CDVTimer][splashscreen] 38.980007ms
2018-02-14 09:04:38.706214-0800 MyFAXbus[7256:3465304] [CDVTimer][TotalPluginStartup] 46.350002ms
2018-02-14 09:04:59.609161-0800 MyFAXbus[7256:3465304] Failed to load webpage with error: The request timed out.


#14

Found the issue:

OS Quirks
Since iOS 10 it’s mandatory to provide an usage description in the info.plist if trying to access privacy-sensitive data. When the system prompts the user to allow access, this usage description string will displayed as part of the permission dialog box, but if you didn’t provide the usage description, the app will crash before showing the dialog. Also, Apple will reject apps that access private data but don’t provide an usage description.

This plugins requires the following usage description:

NSLocationWhenInUseUsageDescription describes the reason that the app accesses the user’s location.
To add this entry into the info.plist, you can use the edit-config tag in the config.xml like this:

need location access to find things nearby

#15

@cityfresno Cool, Let us know if it works for you!


#16

You the man. Worked for me.

EDIT: I just realized how old this page is. Strange, that is the problem I was having on iOS 11.3 on iPhone 7s. This fixed it.