RC4 seems slower to load the app

Hello.

I’ve updated my app to use ionic v2 RC4 today, and when I’ve run the app on my Android device, the app’s loading time has increased a bit in comparison with the previous ionic 2 version.

Now, after the splashscreen fades, the app still spends about 2 seconds more in a blank screen before showing the app.

Is anyone else experiencing this issue? Any advice about what can I do?

1 Like

Have you also upgraded ionic-app-scripts to 0.0.47? If so the builds are now in development (non-AoT) mode by default. Use ionic run android --prod to do a production build with AoT and minification. This should result in faster boot time.

See here for details:

Thanks for the reply.

If I run ionic run android --prod --device, now the app just stays on a blank screen. It doesn’t load at all =(

If I run without the --prod parameter, it works fine.

Is there a way to recompile everything from scratch? Maybe that’s the problem…

It is NOT “–prod” the command is “-prod”

EDIT: the command is “–prod” not my falsely advertised “-prod”. As pointed out by several people below.

Ok, I’ve tried with “-prod” and now the app works fine. But the loading is just the same as without it.

I’ve tried deleting the platform/android folder and now I’ve been doomed! The app icon and splashscreen stopped working.

I have already tried running ionic resources again but with no success.

Man, I have no idea how to fix this…

Why did you delete the platform folder? You can delete the android folder INSIDE the platform folder, but not the whole thing!

You’ll have to re-create the folder structure by creating platforms folder in the root. Then adding platforms.json with the content:
{ }
in there.
Next you have to run “ionic platform add android”.

Finally run “ionic resources”

Alex, I had deleted only the android folder, not all the platforms folder.

Any way, I’ve done as you said, readded the android platform and run again ionic resources with no success.

It just doesn’t use my icon and splashscreen anymore. It keeps using cordova’s ones.

Is there anything else I can do? I’ve really regreted upgrading to RC4 =/

Ah, also, I’ve noticed you are wrong, Alex, about the prod compiling. If I use “-prod”, it compiles the dev version. That’s why the app works.

If I use “–prod” it actually prints “build prod started …” . But then, the prod version of the app doesn’t work.

According to the link below it is --prod.
https://github.com/driftyco/ionic-app-scripts/blob/master/CHANGELOG.md#dev-builds-by-default-changes

You could check the files in www/build to see if minification was used or not.

For the splashscreen and icon issue, try:

ionic platform rm android
ionic platform add android@latest
ionic resources

See https://github.com/driftyco/ionic-cli/issues/1683

pwespi, thank you very much!!! Guess the android@latest has done the trick for the icon and splashscreen issue!!!

Unfortunately, running the app with “–prod” still renders a blank screen, and running in dev mode still has the slow loading =/

1 Like

I am also seeing a big difference in load time. I just upgraded to RC4, scrips 0.47 and in prod mode too its take like 10sec to load the app. It was loading under 5 sec with rc3 and 0.45.

Please file an issue on the app-scripts repo.

Should I file two issues? One for the prod version of the app not working
and another for the slow app loading?

There are currently two issues regarding the blank screen. If you open the browser console you’ll probably also see there is an error "Uncaught Error: Cannot find module “./app.module.ngfactory” If not it might be another bug.


1 Like

I was using ios-depoy and ios-sim to run on device. When I use build and then run from xcode, the boot time is again back to ~5 sec. Just putting this here is someone seeing this issue.
Edit: I was wrong the time it takes is still about 9 seconds. This is not very good.

Hi, osi!

Thank you very much for your reply!!!

By reading the issues, one of the solutions have worked for me.

I just downgraded my typescript version to “2.0.9” on package.json and ran “npm upgrade”.

After that, running “ionic run android --prod --device” worked fine and even very fast!!! The app’s loading time is even faster than on RC3 now!

Here is my package.json config for anyone who is curious:

{
“name”: “ionic-hello-world”,
“author”: “Ionic Framework”,
“homepage”: “http://ionicframework.com/”,
“private”: true,
“scripts”: {
“ionic:build”: “ionic-app-scripts build”,
“ionic:serve”: “ionic-app-scripts serve”
},
“dependencies”: {
"@angular/common": “2.2.1”,
"@angular/compiler": “2.2.1”,
"@angular/compiler-cli": “2.2.1”,
"@angular/core": “2.2.1”,
"@angular/forms": “2.2.1”,
"@angular/http": “2.2.1”,
"@angular/platform-browser": “2.2.1”,
"@angular/platform-browser-dynamic": “2.2.1”,
"@angular/platform-server": “2.2.1”,
"@ionic/storage": “1.1.6”,
“ionic-angular”: “2.0.0-rc.4”,
“ionic-native”: “2.2.11”,
“ionicons”: “3.0.0”,
“rxjs”: “5.0.0-beta.12”,
“zone.js”: “0.6.26”,
“ng2-translate”: “^4.0.1”
},
“devDependencies”: {
"@ionic/app-scripts": “0.0.47”,
“typescript”: “2.0.9”
},
“cordovaPlugins”: [
“cordova-plugin-whitelist”,
“cordova-plugin-console”,
“cordova-plugin-statusbar”,
“cordova-plugin-device”,
“cordova-plugin-splashscreen”,
“ionic-plugin-keyboard”
],
“cordovaPlatforms”: [],
“description”: “DWMasterCompanion: An Ionic project”
}

And here is my ionic info:

Your system information:

Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.17
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.47
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v7.2.0
Xcode version: Not installed

Hello @danielsousat,

Could you please confirm that using 2.0.9 version of typescript helped you? It is mentioned in official guide for migration to use 2.0.9 and I have performance issues with it.

Hi. Yes, I confirm that typescript v 2.0.9 has worked for me.

But I have to state that my app is pretty simple. And the only performance issue I had was the app’s loading time, that was solved by using typescript 2.0.9 along with the --prod build of the app.

Ah, shoot. I develop for iOS and the – was broken by the newline!

Ah yes, I’ve tested only on Android. I don’t how is the perfromance on iOS.