In my ionic app takes too much time when start up


#1

i have ionic 2 app that take 25 sec in spalsh screen then display home data

in my app i have plugin list is below and that all are necessary

card.io.cordova.mobilesdk 2.1.0 "CardIO"
com.paypal.cordova.mobilesdk 3.5.0 "PayPalMobile"
cordova-plugin-braintree 0.5.1 "Braintree Plugin"
cordova-plugin-camera 2.4.0 "Camera"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-console 1.0.5 "Console"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-facebook4 1.7.4 "Facebook Connect"
cordova-plugin-file 4.3.2 "File"
cordova-plugin-file-transfer 1.6.2 "File Transfer"
cordova-plugin-filepath 1.0.2 "FilePath"
cordova-plugin-image-picker 1.1.1 "ImagePicker"
cordova-plugin-nativestorage 2.2.2 "NativeStorage"
cordova-plugin-network-information 1.3.3 "Network Information"
cordova-plugin-safariviewcontroller 1.4.7 "SafariViewController"
cordova-plugin-splashscreen 4.0.1 "Splashscreen"
cordova-plugin-statusbar 2.2.1 "StatusBar"
cordova-plugin-stripe 1.4.0 "cordova-plugin-stripe"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-sqlite-storage 2.0.4 "Cordova sqlite storage plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"
onesignal-cordova-plugin 2.1.2 “OneSignal Push Notifications”

can any one have solution how can i reduce boot up time in my app ?


#2

How are you building the app?

Do you have any “crazy” start-up logic?

Are you using the latest ionic-app-script?


#3

i have build marketplace app
ionic-app-script version is 2.1.4


#4

Sorry, I mostly meant are you building with --prod?

You should also try updating your ionic-app-scripts.


#5

yes i am build in -prod mode


#6

Are you using lazy loading? If not, you should. Moreover, in your config.xml use the following, it will speed up the loading process:

<preference name="SplashScreenDelay" value="100" />
<preference name="FadeSplashScreenDuration" value="1000" />
<preference name="AutoHideSplashScreen" value="false" />

#7

@amjadyahya no i am not use lazy loading

app takes time only when first time open inner pages it’s work fine

i am also used it in config.xml
it’s take still 24-26 sec to open


#8

Inner pages work fine because when you launch the app it loads all pages to memory -when you are not using lazy loading- which results in long loading start-up time. Try it with Lazy Loading lazy loading part 1 and Lazy loading part 2.


#9

What is your ionic info output?
What is the exact command you use to build your app?
How many pages do you have in your app?
Do you really use all those native plugins? Stripe, Braintree and Paypal?


#10

@Sujan12
my app ionic info output is below
Your system information:

Cordova CLI: 7.0.1
Ionic Framework Version: 2.0.0-rc.5
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 2.1.4
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 7
Node Version: v7.2.1
Xcode version: Not installed

command for build app
ionic build android -prod

number of pages in app is 90

Stripe, Braintree and Paypal these all are require


#11

@amjadyahya
i think lazy loading doesn’t work in ionic 2


#12

There you go, having 90 pages to load at startup is causing the app to launch in 24-26 seconds, upgrade to ionic 3 and start using lazy loading, there is no solution for your current situation unless you use ionic 3+.


#13

@amjadyahya any alternate option except ionic 3


#14

This is all super old and should seriously be updated. With a RC version you will never get good performance.
Same for the CLI and app-scripts.

The correct parameter would be --prod, not -prod.


#15

@Sujan12 when i am use --prod then
image


#16

Upgrade your packages, problem will be gone. This was fixed ages ago.


#17

@Sujan12 can you tell me to what version i should upgrade ionic framework which is right now 2.0.0-rc.5?

and according to that latest version of ionic framework, what would be the compatible version of ionic cli,ionic app lib and ionic app scripts


#18

Go here and follow the instructions to download the latest packages.


#19

All of it to the newest if possible. Otherwise, whatever you are comfortable with and can handle.