How to speed up my app?


#1

when i’m opening my app it taken after 30 sec to open my login window? how to overcome my opening sec into 5


#2

How do you build your app?


#3

ionic run android

Ionic app shows white screen after splash for 14-15 second


#4

Add --prod at the end of the command for a minified and optimized build.


#5

is not working for me


#6

And what should I do with this comment now?


#7

any other config will added to get the perfect out for my query.


#8

What do you mean by ‘is not working’? Do you get an error, or still slow speed up times? Could you please provide some more info? In a normal situation, running a simple app with --prod like ionic cordova run android --prod shouldn’t take more then a couple of seconds to boot up on a normal device.

It could be that you have a blocking process somehow, or you’re not building correctly or you have hundreds of pages. Please provide us something to work with first. Explain what you’ve tried to boost your app etc.


#9

when i’m running this command (ionic cordova run android --prod) getting following error.
i dont know what to do i?
[16:56:11] build prod failed: can’t find symbol KeyRegistry exported from module D:/Arul MaNo/Ionic Project
Git/PCMERP/node_modules/@angular/core/src/di/reflective_key.d.ts
[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of
date.
Error: can’t find symbol KeyRegistry exported from module D:/Arul MaNo/Ionic Project Git/PCMERP/node_modules/@angular/core/src/di/reflective_key.d.ts


#10

Probably some messed up dependencies. Could you please output your ionic info over here and the contents of your package.json?


#11

This is my output of Ionic info:

PS D:\Arul MaNo\Ionic Project Git\PCMERP> ionic info

global packages:

@ionic/cli-utils : 1.4.0
Cordova CLI      : 6.5.0
Ionic CLI        : 3.4.0

local packages:

@ionic/app-scripts              : 1.1.3
@ionic/cli-plugin-cordova       : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms               : android 6.1.2
Ionic Framework                 : ionic-angular 2.1.0

System:

Node       : v6.9.1
OS         : Windows 10
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed
npm        : 4.5.0

and

My Package.json:

{
“name”: “ionic-hello-world”,
“author”: “Ionic Framework”,
“homepage”: “http://ionicframework.com/”,
“private”: true,
“scripts”: {
“clean”: “ionic-app-scripts clean”,
“build”: “ionic-app-scripts build”,
“ionic:build”: “ionic-app-scripts build”,
“ionic:serve”: “ionic-app-scripts serve”
},
“dependencies”: {
"@angular/common": “2.4.8”,
"@angular/compiler": “2.4.8”,
"@angular/compiler-cli": “2.4.8”,
"@angular/core": “2.4.8”,
"@angular/forms": “2.4.8”,
"@angular/http": “2.4.8”,
"@angular/platform-browser": “2.4.8”,
"@angular/platform-browser-dynamic": “2.4.8”,
"@angular/platform-server": “2.4.8”,
"@ionic-native/core": “3.1.0”,
"@ionic-native/splash-screen": “3.1.0”,
"@ionic-native/status-bar": “3.1.0”,
"@ionic/storage": “2.0.0”,
“ionic-angular”: “2.3.0”,
“ionicons”: “3.0.0”,
“rxjs”: “5.0.1”,
“sw-toolbox”: “3.4.0”,
“zone.js”: “0.7.2”
},
“devDependencies”: {
"@ionic/app-scripts": “1.2.2”,
"@ionic/cli-plugin-cordova": “1.4.0”,
"@ionic/cli-plugin-ionic-angular": “1.3.1”,
“typescript”: “2.0.9”
},
“cordovaPlugins”: [
“cordova-plugin-whitelist”,
“cordova-plugin-statusbar”,
“cordova-plugin-console”,
“cordova-plugin-splashscreen”,
“cordova-plugin-device”,
“ionic-plugin-keyboard”
],
“cordovaPlatforms”: [],
“description”: “PCMERP: An Ionic project”
}


#12

Okay, this is probably due to some outdated dependencies. Please update your framework to the latest version, as well as your ionic app scripts and other dependencies.


#13

If you don’t mine please give me a commands(for All updates)


#14

Just compare your package.json to the one from the ionic conference app over here:

change the versions to the latest ones, remove your node_modules and run npm install again to reinstall all dependencies.


#15

can i copy paste the same package.json config in my file


#16

If you’re lazy and don’t have any other dependencies in your own project, yes you can. But you probably don’t want to copy over the names and stuff.


#17

Ok. i know one thing how to remove node_modules
is this correct command for me to use npm uninstall node_modules


#18

just delete the folder through your terminal or finder. That will do.


#19

to hide white screen you must add a loader before init app

  initializeApp() {
	      this.loader = this.loadingCtrl.create({
      content: "Wait ...",
	  spinner:"dots" 
    });
	    this.loader.present();
    this.platform.ready().then(() => {
      StatusBar.styleDefault();
      Splashscreen.hide();
	  this.loader.dismiss();
	
  }

Splash screen & main screen loading
#20

Yes a spinner would be nice for the user (if it really takes this long), but if your app has startup times of > 20 seconds you should seriously look at the problems that are causing these enormous loading times.