App installs but is stuck on splash screen with loading icon

Hey everyone,

I recently updated my Ionic project to utilize Ionic 3/Angular 4. The problem is that when I run ionic cordova build ios --env=prod, install the app on my ios device and try to run it, I see it all fire up in the Xcode console but then it gets to the splash screen, sits for a few seconds and then a small loading icon pops up and goes nowhere.

Here is my Xcode console:

2017-05-24 11:32:38.847067 Bandly[44677:10043899] [DYMTLInitPlatform] platform initialization successful
2017-05-24 11:32:38.926729 Bandly[44677:10043713] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///private/var/mobile/Containers/Data/Application/5892A7A9-BBE6-4E85-9C20-13047B9F7700/Library/Cookies/Cookies.binarycookies
2017-05-24 11:32:38.993698 Bandly[44677:10043713] Apache Cordova native platform version 4.3.1 is starting.
2017-05-24 11:32:38.994685 Bandly[44677:10043713] Multi-tasking -> Device: YES, App: YES
2017-05-24 11:32:39.066006 Bandly[44677:10043713] CDVWKWebViewEngine: trying to inject XHR polyfill
2017-05-24 11:32:39.083199 Bandly[44677:10043713] CDVWKWebViewEngine will reload WKWebView if required on resume
2017-05-24 11:32:39.083268 Bandly[44677:10043713] Using WKWebView
2017-05-24 11:32:39.083725 Bandly[44677:10043713] [CDVTimer][handleopenurl] 0.134945ms
2017-05-24 11:32:39.086092 Bandly[44677:10043713] Unlimited access to network resources
2017-05-24 11:32:39.086212 Bandly[44677:10043713] [CDVTimer][intentandnavigationfilter] 2.409995ms
2017-05-24 11:32:39.086362 Bandly[44677:10043713] [CDVTimer][gesturehandler] 0.062048ms
2017-05-24 11:32:39.086756 Bandly[44677:10043713] [CDVTimer][admob] 0.292957ms
2017-05-24 11:32:39.086950 Bandly[44677:10043713] Starting Facebook Connect plugin
2017-05-24 11:32:39.087053 Bandly[44677:10043713] [CDVTimer][facebookconnectplugin] 0.235021ms
2017-05-24 11:32:39.105823 Bandly[44677:10043713] [CDVTimer][file] 18.662989ms
2017-05-24 11:32:39.132296 Bandly[44677:10043713] [CDVTimer][splashscreen] 26.371956ms
2017-05-24 11:32:39.135341 Bandly[44677:10043713] [CDVTimer][statusbar] 2.936959ms
2017-05-24 11:32:39.141330 Bandly[44677:10043713] [CDVTimer][keyboard] 5.795002ms
2017-05-24 11:32:39.141500 Bandly[44677:10043713] [CDVTimer][TotalPluginStartup] 57.976007ms
2017-05-24 11:32:39.221147 Bandly[44677:10043713] DidFinishLaunchingWithOptions
2017-05-24 11:32:39.225: <FIRMessaging/INFO> FIRMessaging library version 1.2.0
2017-05-24 11:32:39.296408 Bandly[44677:10043887] [Firebase/Core][I-COR000001] Configuring the default app.
2017-05-24 11:32:39.297 Bandly[44677] <Debug> [Firebase/Core][I-COR000001] Configuring the default app.
2017-05-24 11:32:39.301: <FIRInstanceID/WARNING> FIRInstanceID AppDelegate proxy enabled, will swizzle app delegate remote notification handlers. To disable add "FirebaseAppDelegateProxyEnabled" to your Info.plist and set it to NO
2017-05-24 11:32:39.301: <FIRInstanceID/WARNING> Failed to fetch APNS token Error Domain=com.firebase.iid Code=1001 "(null)"
2017-05-24 11:32:39.305: <FIRMessaging/WARNING> FIRMessaging AppDelegate proxy enabled, will swizzle app delegate remote notification receiver handlers. Add "FirebaseAppDelegateProxyEnabled" to your Info.plist and set it to NO
2017-05-24 11:32:39.312752 Bandly[44677:10043887] <FIRAnalytics/INFO> Firebase Analytics v.3403000 started
2017-05-24 11:32:39.338 Bandly[44677:] <FIRAnalytics/INFO> Firebase Analytics v.3403000 started
2017-05-24 11:32:39.341060 Bandly[44677:10043713] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2017-05-24 11:32:39.342926 Bandly[44677:10043887] <FIRAnalytics/INFO> To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/Y0Yjwu)
2017-05-24 11:32:39.343 Bandly[44677:] <FIRAnalytics/INFO> To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/Y0Yjwu)
2017-05-24 11:32:39.343983 Bandly[44677:10043713] [MC] Reading from public effective user settings.
2017-05-24 11:32:39.393128 Bandly[44677:10043713] app become active
2017-05-24 11:32:39.399539 Bandly[44677:10043887] <FIRAnalytics/INFO> Successfully created Firebase Analytics App Delegate Proxy automatically. To disable the proxy, set the flag FirebaseAppDelegateProxyEnabled to NO in the Info.plist
2017-05-24 11:32:39.399 Bandly[44677:] <FIRAnalytics/INFO> Successfully created Firebase Analytics App Delegate Proxy automatically. To disable the proxy, set the flag FirebaseAppDelegateProxyEnabled to NO in the Info.plist
2017-05-24 11:32:39.409479 Bandly[44677:10043919] [Firebase/Core][I-COR000018] Already sending logs.
2017-05-24 11:32:39.442 Bandly[44677] <Debug> [Firebase/Core][I-COR000018] Already sending logs.
2017-05-24 11:32:39.574518 Bandly[44677:10043888] [Firebase/Core][I-COR000019] Clearcut post completed.
2017-05-24 11:32:39.574 Bandly[44677] <Debug> [Firebase/Core][I-COR000019] Clearcut post completed.
2017-05-24 11:32:39.915240 Bandly[44677:10043887] [Firebase/Core][I-COR000019] Clearcut post completed.
2017-05-24 11:32:39.918 Bandly[44677] <Debug> [Firebase/Core][I-COR000019] Clearcut post completed.
2017-05-24 11:32:40.993892 Bandly[44677:10043886] <FIRAnalytics/INFO> Firebase Analytics enabled
2017-05-24 11:32:40.994 Bandly[44677:] <FIRAnalytics/INFO> Firebase Analytics enabled
2017-05-24 11:32:41.025186 Bandly[44677:10043713] InstanceID token: e4BK6D6JYFo:APA91bGZhp3flKWTw8955Q-ZiFdv7MWu0yj38GwkB0fPz5mc6wZQ4EOi9Jcz5r4BRFntRx41b4xDm8f7S6UufDs5w-JWtMPSWA7AUgT6DmLfrMcNW9r_Yz9AiCjp9rMkcDCZa3xGbLEX
2017-05-24 11:32:41.391182 Bandly[44677:10043713] Connected to FCM.
2017-05-24 11:32:41.394: <FIRMessaging/WARNING> Failed to subscribe to topic Error Domain=com.google.fcm Code=5 "(null)"
2017-05-24 11:32:41.394: <FIRMessaging/WARNING> Failed to subscribe to topic Error Domain=com.google.fcm Code=5 "(null)"
2017-05-24 11:32:41.404: <FIRMessaging/WARNING> Failed to subscribe to topic Error Domain=com.google.fcm Code=5 "(null)"
2017-05-24 11:32:41.404: <FIRMessaging/WARNING> Failed to subscribe to topic Error Domain=com.google.fcm Code=5 "(null)"
2017-05-24 11:32:41.530896 Bandly[44677:10043713] app become active
2017-05-24 11:32:41.791696 Bandly[44677:10043713] Connected to FCM.
2017-05-24 11:32:41.793: <FIRMessaging/WARNING> Failed to subscribe to topic Error Domain=com.google.fcm Code=5 "(null)"
2017-05-24 11:32:41.793: <FIRMessaging/WARNING> Failed to subscribe to topic Error Domain=com.google.fcm Code=5 "(null)"
2017-05-24 11:32:41.793: <FIRMessaging/WARNING> Failed to subscribe to topic Error Domain=com.google.fcm Code=5 "(null)"
2017-05-24 11:32:41.793: <FIRMessaging/WARNING> Failed to subscribe to topic Error Domain=com.google.fcm Code=5 "(null)"
2017-05-24 11:32:42.685: <FIRInstanceID/WARNING> APNS Environment in profile: development
2017-05-24 11:32:43.034711 Bandly[44677:10043713] FCMPlugin.js: is created
2017-05-24 11:32:43.034969 Bandly[44677:10043713] Ionic Native: deviceready event fired after 2717 ms
2017-05-24 11:32:43.042632 Bandly[44677:10043713] Cordova view ready
2017-05-24 11:32:43.044955 Bandly[44677:10043713] FCMPlugin Ready OK
2017-05-24 11:32:43.255217 Bandly[44677:10043713] InstanceID token: e4BK6D6JYFo:APA91bGZhp3flKWTw8955Q-ZiFdv7MWu0yj38GwkB0fPz5mc6wZQ4EOi9Jcz5r4BRFntRx41b4xDm8f7S6UufDs5w-JWtMPSWA7AUgT6DmLfrMcNW9r_Yz9AiCjp9rMkcDCZa3xGbLEX
2017-05-24 11:32:43.255293 Bandly[44677:10043713] stringByEvaluatingJavaScriptFromString FCMPlugin.onTokenRefreshReceived('e4BK6D6JYFo:APA91bGZhp3flKWTw8955Q-ZiFdv7MWu0yj38GwkB0fPz5mc6wZQ4EOi9Jcz5r4BRFntRx41b4xDm8f7S6UufDs5w-JWtMPSWA7AUgT6DmLfrMcNW9r_Yz9AiCjp9rMkcDCZa3xGbLEX');
2017-05-24 11:32:43.258166 Bandly[44677:10043713] Received token refresh
2017-05-24 11:32:43.258447 Bandly[44677:10043713] e4BK6D6JYFo:APA91bGZhp3flKWTw8955Q-ZiFdv7MWu0yj38GwkB0fPz5mc6wZQ4EOi9Jcz5r4BRFntRx41b4xDm8f7S6UufDs5w-JWtMPSWA7AUgT6DmLfrMcNW9r_Yz9AiCjp9rMkcDCZa3xGbLEX
2017-05-24 11:32:43.500313 Bandly[44677:10043713] Connected to FCM.

^ Does anyone see a potential issue here that might be causing it to break? Prior to Ionic 3, This same code worked fine and I was able to run my app on my device.

For reference, here are my dependencies:

"dependencies": {
        "@angular/common": "4.0.2",
        "@angular/compiler": "4.0.2",
        "@angular/compiler-cli": "4.0.2",
        "@angular/core": "4.0.2",
        "@angular/forms": "4.0.2",
        "@angular/http": "4.0.2",
        "@angular/platform-browser": "4.0.2",
        "@angular/platform-browser-dynamic": "4.0.2",
        "@ionic-native/camera": "^3.8.0",
        "@ionic-native/core": "3.6.1",
        "@ionic-native/facebook": "^3.8.0",
        "@ionic-native/file": "^3.6.1",
        "@ionic-native/geolocation": "^3.8.0",
        "@ionic-native/in-app-browser": "^3.8.0",
        "@ionic-native/keyboard": "^3.8.0",
        "@ionic-native/splash-screen": "3.6.1",
        "@ionic-native/status-bar": "3.6.1",
        "@ionic-native/transfer": "^3.8.0",
        "@ionic/storage": "2.0.1",
        "@types/algoliasearch": "^3.18.0",
        "@types/jasmine": "^2.5.41",
        "@types/lodash": "^4.14.55",
        "@types/lodash.update": "^4.10.1",
        "algoliasearch": "^3.21.1",
        "angular2-autosize": "^1.0.1",
        "angular2-moment": "^1.0.0",
        "angularfire2": "^2.0.0-beta.7",
        "cordova-android": "6.1.0",
        "cordova-ios": "^4.3.1",
        "cordova-plugin-camera": "~2.3.1",
        "cordova-plugin-console": "1.0.5",
        "cordova-plugin-crosswalk-webview": "~2.2.0",
        "cordova-plugin-device": "~1.1.4",
        "cordova-plugin-facebook4": "~1.7.4",
        "cordova-plugin-file": "~4.3.1",
        "cordova-plugin-file-transfer": "~1.6.1",
        "cordova-plugin-geolocation": "~2.4.1",
        "cordova-plugin-inappbrowser": "~1.4.0",
        "cordova-plugin-splashscreen": "~4.0.1",
        "cordova-plugin-statusbar": "2.2.1",
        "cordova-plugin-whitelist": "~1.3.1",
        "cordova-plugin-wkwebview-engine": "https://github.com/driftyco/cordova-plugin-wkwebview-engine.git",
        "firebase": "^3.7.2",
        "ionic-angular": "3.1.1",
        "ionic-plugin-keyboard": "~2.2.1",
        "ionicons": "3.0.0",
        "lodash": "^4.17.2",
        "moment": "^2.17.1",
        "ng-semantic": "^1.1.13",
        "rxjs": "5.1.1",
        "sw-toolbox": "3.4.0",
        "zone.js": "^0.8.10"
    },
    "devDependencies": {
        "@angular/cli": "^1.0.4",
        "@ionic/app-scripts": "1.3.0",
        "@ionic/cli-plugin-cordova": "1.1.2",
        "@ionic/cli-plugin-ionic-angular": "1.1.2",
        "typescript": "~2.2.1"
    }

I should also note that for whatever reason, I’m getting this error when I run the build command:

✖ Running command - failed!

[ERROR] Cordova encountered an error.
        You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova build ios (exit code 1):

Thoughts on what could be going on here?

Thanks in advance!

Can you try attaching with Safari instead? I find that generally much more informative than the Xcode console.

Same issue here! driving me bonkers! Glad I waited till after our launch to update!

  "dependencies": {
    "@angular/common": "4.1.0",
    "@angular/compiler": "4.1.0",
    "@angular/compiler-cli": "4.1.0",
    "@angular/core": "4.1.0",
    "@angular/forms": "4.1.0",
    "@angular/http": "4.1.0",
    "@angular/platform-browser": "4.1.0",
    "@angular/platform-browser-dynamic": "4.1.0",
    "@ionic-native/core": "3.6.1",
    "@ionic-native/deeplinks": "^3.10.3",
    "@ionic-native/device": "^3.10.3",
    "@ionic-native/google-analytics": "^3.10.3",
    "@ionic-native/http": "^3.10.3",
    "@ionic-native/keyboard": "^3.10.3",
    "@ionic-native/screen-orientation": "^3.10.3",
    "@ionic-native/splash-screen": "3.6.1",
    "@ionic-native/sqlite": "^3.10.3",
    "@ionic-native/status-bar": "^3.6.1",
    "@ionic/storage": "2.0.1",
    "angular-svg-round-progressbar": "^1.1.0",
    "angular2-progressbar": "^0.5.1",
    "ionic-angular": "3.2.0",
    "ionicons": "3.0.0",
    "ng2-charts": "^1.5.0",
    "rxjs": "5.1.1",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.10"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.3.7",
    "@ionic/cli-plugin-cordova": "1.1.2",
    "@ionic/cli-plugin-ionic-angular": "1.1.2",
    "typescript": "2.2.1"
  },
global packages:

    @ionic/cli-utils : 1.2.0
    Cordova CLI      : 6.5.0 
    Ionic CLI        : 3.2.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.1.2
    @ionic/cli-plugin-ionic-angular : 1.1.2
    Ionic Framework                 : ionic-angular 3.2.0

System:

    Node       : v7.2.1
    OS         : macOS Sierra
    Xcode      : Xcode 8.3.2 Build version 8E2002 
    ios-deploy : 1.9.1 
    ios-sim    : 3.1.1 

what do you mean attaching with safari? Is there a way to do that?

Actually, I was able to look at it in the safari inspector and it gave me this error:

http://localhost:8080/var/containers/Bundle/Application/E858D475-CBBC-43A2-B856-67CB7E6EFE40/Bandly.app/www/build/main.jsWebSocket connection to 'wss://s-usc1c-nss-121.firebaseio.com/.ws?v=5&ns=bandly-58c5c' failed: Failed to send WebSocket frame.

So probably an issue with Firebase and my version of iOS?

any updates on this? having the same problem

hey I got your email. Is your xcode project giving you any errors? To be frank, I can’t remember exactly what the issue was and what I did, because anymore I just run ionic cordova build ios --prod and it’s able to build

I have the same issue. I can run ionic cordova build ios --prod, and install the app in my device with iOS 11. But devices with iOS 10.3.3 my app stuck on splash screen with loading icon. What can i do?

I have the same issue here, someone have a workaround?

Same here. Any updates/solutions/suggestions? Anybody???

@snstarosciak @MGA93 @mydoal2 @anterodev @timonggg

I had to revert from @ionic/app-scripts 3.1.10 to 2.1.4 to get my app to be responsive again with --prod builds. More details in my SO answer:

https://stackoverflow.com/a/51510124/1467810

I figured out why this happen. I updated the ECMAScript 5 to 6 or 7, and the oldest devices doesn’t are compatible with the new versions of ES6+, for that i downgraded the target in the tsconfig.json file, to es5, then i compile the app in iOS 10.3.3 and oldest devices, and works! (at least to me)