Issue with app boot time

#1

Ionic version:
2.2.0

Current behavior:
Using ionic2 and angular2 we build almost 13-14 small features/module.
I dont understand why my app takes too much time (20-22 seconds) to hide splashscreen/load app.

Hello everyone, after frustrating too much to find solutions how to decrease time to load app

Expected behavior:
It takes maximum 4-5 seconds to hide splashscreen and load module perfectly.

Package.json

{
  "name": "Yugma-Management",
  "author": "NxtLife Team",
  "homepage": "http://www.nxtlifetechnologies.com/",
  "private": true,
  "scripts": {
    "build": "ionic-app-scripts build",
    "watch": "ionic-app-scripts watch",
    "serve:before": "watch",
    "emulate:before": "build",
    "deploy:before": "build",
    "build:before": "build",
    "run:before": "build",
    "postinstall": "typings install"
  },
  "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-native/camera": "^3.4.4",
    "@ionic-native/core": "^3.1.0",
    "@ionic-native/file": "^3.4.4",
    "@ionic-native/file-chooser": "^3.4.4",
    "@ionic-native/transfer": "^3.4.4",
    "angular2-moment": "^1.0.0-beta.rc.1",
    "intl": "^1.2.5",
    "ionic-angular": "2.2.0",
    "ionic-gallery-modal": "^0.1.1",
    "ionic-native": "^2.2.3",
    "ionic2-calendar": "^0.2.4",
    "ionic2-rating": "0.0.10",
    "ionicons": "3.0.0",
    "nxtlife-ionic2-rating": "^1.0.3",
    "rxjs": "5.0.0-beta.12",
    "sw-toolbox": "3.4.0",
    "typings": "1.3.1",
    "underscore": "^1.8.3",
    "zone.js": "0.6.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "^1.1.4",
    "typescript": "2.0.6"
  },
  "cordovaPlugins": [
    "cordova-plugin-whitelist",
    "cordova-plugin-statusbar",
    "cordova-plugin-device",
    "cordova-plugin-console",
    "ionic-plugin-keyboard",
    "cordova-plugin-splashscreen"
  ],
  "cordovaPlatforms": [],
  "description": "NxtLifeYugma2: An Ionic project"
}

Ionic info:

Cordova CLI: 6.5.0
Ionic Framework Version: 2.2.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.3.7
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.9
Node Version: v6.10.3
Xcode version: Not installed

We build .apk using ionic build android --prod --release command. we also try to use --prod --aot --minify --ngc flags is mentioned in here.

I also refer ionic forum docs.

I just posted the question here also stackoverflow and Ionic Team

1 Like
#2

Is your boot time slow on iOS too? If yes, could you display the logs of Xcode (produced when you start your app)?

#3

@reedrichards I will share logs of Xcode but Its not only for ios device. In android i have same issue.

#4

it’s easier to find the iOS boot logs, therefore I asked about them. if you know how to find the android boot log fine display them but in any case would help to display some logs…

#5

How can i find android boot log?

#6

If you don’t know then iOS Xcode logs gonna be a good start (if you have the problem on iOS too)

#7

I would suggest you upgrade your environment to the most current versions. There are newer ones for all of those:

(Post ionic info again after upgrading, more relevant info in there)

Also you app-scripts doesn’t match your package.json:

What is up with that?

Can you post your config.xml, the plugins in package.json don’t match your ionic-native plugins (but that is probably because you are using npm <5 so should not be a serious issue).

Upgrading this would probably help, a lot:

But of course that is quite some work.

#8

@reedrichards Android logs:

[tushar@tushar-angularjs Parent]$ ionic build android

Running 'build:before' npm script before build

> Yugma-Parent@ build /home/tushar/workspace/Yugma-Demo/Parent
> ionic-app-scripts build

[13:21:53]  ionic-app-scripts 1.0.0 
[13:21:53]  build dev started ... 
[13:21:53]  clean started ... 
[13:21:53]  clean finished in 13 ms 
[13:21:53]  copy started ... 
[13:21:53]  transpile started ... 
[13:21:57]  transpile finished in 4.79 s 
[13:21:57]  webpack started ... 
[13:21:58]  copy finished in 5.75 s 
[13:22:11]  webpack finished in 13.75 s 
[13:22:11]  sass started ... 
[13:22:14]  sass finished in 3.31 s 
[13:22:15]  build dev finished in 22.00 s 
[13:22:22]  tslint: src/pages/survey/list/survey-list.ts, line: 5 
            Unused import: 'SurveyPage' 

       L4:  import { ViewSurvey } from '../view/view';
       L5:  import { SurveyPage } from '../survey';
       L6:  import { CustomService } from '../../../service/custom.service';

ANDROID_HOME=/home/tushar/opt/android-sdk-linux/

JAVA_HOME=/home/tushar/opt/jdk1.8.0_60/

Subproject Path: CordovaLib

Incremental java compilation is an incubating feature.

:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE

:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl
 UP-TO-DATE

:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint
 UP-TO-DATE
:CordovaLib:copyDebugLint
 UP-TO-DATE
:CordovaLib:mergeDebugShaders
 UP-TO-DATE

:CordovaLib:compileDebugShaders
 UP-TO-DATE

:CordovaLib:generateDebugAssets UP-TO-DATE

:CordovaLib:mergeDebugAssets
 UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles
 UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript
 
UP-TO-DATE
:CordovaLib:generateDebugResValues
 
UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources
 
UP-TO-DATE
:CordovaLib:processDebugManifest
 UP-TO-DATE

:CordovaLib:generateDebugBuildConfig
 UP-TO-DATE
:CordovaLib:processDebugResources
 UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE

:CordovaLib:incrementalDebugJavaCompilationSafeguard
 UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac
 UP-TO-DATE
:CordovaLib:processDebugJavaRes
 UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug
 UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
 UP-TO-DATE
:CordovaLib:mergeDebugJniLibFolders UP-TO-DATE


:CordovaLib:transformNative_libsWithMergeJniLibsForDebug
 UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug UP-TO-DATE
:CordovaLib:bundleDebug UP-TO-DATE
:prepareAndroidCordovaLibUnspecifiedDebugLibrary
 UP-TO-DATE

:preReleaseBuild
 UP-TO-DATE
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:checkReleaseManifest

:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseAidl
 
UP-TO-DATE
:CordovaLib:compileReleaseNdk UP-TO-DATE

:CordovaLib:copyReleaseLint
 UP-TO-DATE

:CordovaLib:mergeReleaseShaders
 UP-TO-DATE

:CordovaLib:compileReleaseShaders
 UP-TO-DATE
:CordovaLib:generateReleaseAssets UP-TO-DATE

:CordovaLib:mergeReleaseAssets
 UP-TO-DATE
:CordovaLib:mergeReleaseProguardFiles UP-TO-DATE

:CordovaLib:packageReleaseRenderscript
 UP-TO-DATE
:CordovaLib:compileReleaseRenderscript
 UP-TO-DATE
:CordovaLib:generateReleaseResValues
 UP-TO-DATE

:CordovaLib:generateReleaseResources UP-TO-DATE

:CordovaLib:packageReleaseResources
 
UP-TO-DATE

:CordovaLib:processReleaseManifest
 
UP-TO-DATE
:CordovaLib:generateReleaseBuildConfig
 
UP-TO-DATE
:CordovaLib:processReleaseResources
 
UP-TO-DATE
:CordovaLib:generateReleaseSources UP-TO-DATE
:CordovaLib:incrementalReleaseJavaCompilationSafeguard
 
UP-TO-DATE
:CordovaLib:compileReleaseJavaWithJavac
 UP-TO-DATE

:CordovaLib:processReleaseJavaRes
 
UP-TO-DATE

:CordovaLib:transformResourcesWithMergeJavaResForRelease
 
UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease
 UP-TO-DATE

:CordovaLib:mergeReleaseJniLibFolders
 
UP-TO-DATE
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease
 UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease
 UP-TO-DATE
:CordovaLib:bundleRelease UP-TO-DATE

:prepareComAndroidSupportSupportV132340Library
 
UP-TO-DATE

:prepareComAndroidSupportSupportV42411Library
 
UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesBase902Library
 UP-TO-DATE

:prepareComGoogleAndroidGmsPlayServicesBasement902Library
 
UP-TO-DATE


:prepareComGoogleAndroidGmsPlayServicesGcm902Library
 UP-TO-DATE

:prepareComGoogleAndroidGmsPlayServicesIid902Library UP-TO-DATE

:prepareComGoogleAndroidGmsPlayServicesTasks902Library
 UP-TO-DATE
:prepareComGoogleFirebaseFirebaseCommon902Library
 
UP-TO-DATE

:prepareMeLeolinShortcutBadger114Library
 UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl
 UP-TO-DATE
:compileDebugRenderscript
 
UP-TO-DATE

:generateDebugBuildConfig
 UP-TO-DATE

:generateDebugResValues
 UP-TO-DATE

:generateDebugResources 
UP-TO-DATE
:mergeDebugResources
 
UP-TO-DATE

:processDebugManifest
 UP-TO-DATE

:processDebugResources
 
UP-TO-DATE

:generateDebugSources UP-TO-DATE

:incrementalDebugJavaCompilationSafeguard
 
UP-TO-DATE
:compileDebugJavaWithJavac
 UP-TO-DATE
:compileDebugNdk UP-TO-DATE
:compileDebugSources UP-TO-DATE

:mergeDebugShaders
 
UP-TO-DATE
:compileDebugShaders
 UP-TO-DATE
:generateDebugAssets UP-TO-DATE

:mergeDebugAssets
 UP-TO-DATE
:transformClassesWithDexForDebug
 UP-TO-DATE

:mergeDebugJniLibFolders
 UP-TO-DATE

:transformNative_libsWithMergeJniLibsForDebug
 UP-TO-DATE

:processDebugJavaRes
 UP-TO-DATE

:transformResourcesWithMergeJavaResForDebug
 UP-TO-DATE

:validateSigningDebug
:packageDebug
 UP-TO-DATE
:assembleDebug UP-TO-DATE

:cdvBuildDebug
 UP-TO-DATE




BUILD SUCCESSFUL




Total time: 6.698 secs


Built the following apk(s): 
	/home/tushar/workspace/Yugma-Demo/Parent/platforms/android/build/outputs/apk/android-debug.apk

#9

We used ionic v2.2.1 if i upgrade then may be some functionalities not work properly.
and also i have installed Ionic Framework Version: 2.2.0 (Ionic Info) and "ionic-angular": "2.2.0" (package.json)
so i have only one version left.
If you want to update my app-script v1.0.0 to v1.1.4 then i’ll do it.

I don’t think so that’s the main reason to taking too much time (up to my knowledge).

here is my config.xml:

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.aa.aa" version="0.0.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>SRGSParent</name>
    <description>Yugma is a school quality management App for schools and provides a better interface between parent and teachers.
  </description>
    <author email="aaa@aaa.com" href="http://www.nxtlifetechnologies.com/">
    NxtLife Team
  </author>
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
        <preference name="android-targetSdkVersion" value="23" />
        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
        <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
        <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
        <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
        <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
        <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
        <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
        <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
        <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <icon height="57" src="resources/ios/icon/icon.png" width="57" />
        <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
        <icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
        <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
        <icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
        <icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
        <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
        <icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
        <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
        <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
        <icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
        <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
        <icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
        <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
        <icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
        <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
        <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
        <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
        <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
        <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
        <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
        <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
    </platform>
    <preference name="webviewbounce" value="false" />
    <preference name="UIWebViewBounce" value="false" />
    <preference name="DisallowOverscroll" value="true" />
    <preference name="android-minSdkVersion" value="16" />
    <preference name="android-targetSdkVersion" value="23" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <preference name="FadeSplashScreenDuration" value="300" />
    <preference name="SplashScreenDelay" value="3000" />
    <preference name="loadUrlTimeoutValue" value="700000" />
    <preference name="SplashScreen" value="screen" />
    <preference name="AutoHideSplashScreen" value="false" />
    <preference name="ShowSplashScreenSpinner" value="true" />
    <preference name="SplashScreenDelay" value="8000" />
    <preference name="orientation" value="portrait" />
    <preference name="AndroidPersistentFileLocation" value="Compatibility" />
    <feature name="StatusBar">
        <param name="ios-package" onload="true" value="CDVStatusBar" />
    </feature>
    <icon src="resources/ios/icon/icon-small@3x.png" />
    <allow-navigation href="http://192.168.0.21:8100" />
    <engine name="ios" spec="^4.4.0" />
    <plugin name="com.megster.cordova.FileChooser" spec="http://github.com/don/cordova-filechooser.git" />
    <plugin name="cordova-plugin-camera" spec="^2.4.1">
        <variable name="CAMERA_USAGE_DESCRIPTION" value=" " />
        <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value=" " />
    </plugin>
    <plugin name="cordova-plugin-file" spec="^4.3.3" />
    <plugin name="cordova-plugin-file-transfer" spec="^1.6.3" />
    <plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
    <plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
    <plugin name="phonegap-plugin-push" spec="^1.8.2">
        <variable name="SENDER_ID" value="562555006958" />
    </plugin>
</widget>

#10

thx, but, as I wrote before, I meant the logs produced when you start/boot your app, not your build logs

anyway the suggestions provided here above by @Sujan12 look like the good path to follow

#11

Thnks for replying. I will share Xcode build logs as soon as possible.
@Sujan12 talk about version, i don’t think so it is the main reason to taking too much time.
If i update ionic v2.2.0 to v3.. then i assure you my project wont work properly.

#12

First he spoke about your building tools which are not up-to-date (cordova, ionic cli, app-scripts).

Then that’s kind of weird that you can’t upgrade from 2.2.0 to 3 without problems. Libraries changed but everything is retro-compatible

#13

Updating the environment (Ionic CLI, app-scripts, Cordova) just makes sure there is no “cruft” hanging you down. Especially upgrading Ionic CLI will also give better ionic info output we can use to diagnose your problems.

If you do not want to upgrade Ionic (ionic-angular) itself I completely understand - but this will be the biggest lever you can use to improve the boot time. But as I wrote, start with the environment stuff first and stay with ionic-angular 2.2.0.

#14

Hi, i have a 3 secs boot time and ill tell you what i recommend to you (the same i have).

First of all, i recommend to try always get the latest version of ionic-angular (3.4.2 in this case), then you can configure your splash screen like this:

<preference name="AutoHideSplashScreen" value="false"/>
<preference name="SplashScreenDelay" value="10000" />
<preference name="FadeSplashScreenDuration" value="1000" />  
<preference name="SplashScreen" value="screen" />
<preference name="ShowSplashScreen" value="true" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="FadeSplashScreen" value="true" />

Then in your app.component add this:

this.splashScreen.hide();

After platform ready I have to say that i only have the default ones (console, device, splashscreen, statusbar, whitelist) adn this are the version:

<plugin name="cordova-plugin-console" spec="~1.0.4"/>
<plugin name="cordova-plugin-device" spec="~1.1.3"/>
<plugin name="cordova-plugin-whitelist" spec="~1.3.0"/>
<plugin name="cordova-plugin-statusbar" spec="~2.2.0"/>
<plugin name="cordova-plugin-splashscreen" spec="~4.0.0"/>

Other thing to keep in mind is always try to get the latest android, ios platform too.

Hope this can help you :blush: :blush:

1 Like
#15

@Sujan12 and @reedrichards Please check:

Ionic Info:

[tushar@tushar-angularjs Parent (copy)]$ ionic info

global packages:

    @ionic/cli-plugin-proxy : 1.3.2
    @ionic/cli-utils        : 1.5.0
    Cordova CLI             : 7.0.1 
    Ionic CLI               : 3.5.0

local packages:

    @ionic/app-scripts              : 2.0.0
    @ionic/cli-plugin-cordova       : 1.4.1
    @ionic/cli-plugin-ionic-angular : 1.3.2
    Cordova Platforms               : android 6.1.2 browser 4.1.0
    Ionic Framework                 : ionic-angular 3.5.0

System:

    Node       : v6.10.3
    OS         : Linux 4.9
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
    npm        : 3.10.10 

Package.json:

{
    "name": "Yugma-Parent",
    "author": "NxtLife Team",
    "homepage": "http://www.nxtlifetechnologies.com/",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "lint": "ionic-app-scripts lint",
        "ionic:build": "ionic-app-scripts build",
        "ionic:serve": "ionic-app-scripts serve",
        "postinstall": "typings install"
    },
    "dependencies": {
        "@angular/common": "4.1.3",
        "@angular/compiler": "4.1.3",
        "@angular/compiler-cli": "4.1.3",
        "@angular/core": "4.1.3",
        "@angular/forms": "4.1.3",
        "@angular/http": "4.1.3",
        "@angular/platform-browser": "4.1.3",
        "@angular/platform-browser-dynamic": "4.1.3",
        "@angular/platform-server": "2.2.1",
        "@ionic-native/camera": "^3.14.0",
        "@ionic-native/core": "3.12.1",
        "@ionic-native/file": "^3.4.4",
        "@ionic-native/file-chooser": "^3.4.4",
        "@ionic-native/keyboard": "^3.6.1",
        "@ionic-native/splash-screen": "^3.12.1",
        "@ionic-native/status-bar": "3.12.1",
        "@ionic-native/transfer": "^3.4.4",
        "@ionic/storage": "2.0.1",
        "angular2-moment": "^1.0.0-beta.rc.1",
        "intl": "^1.2.5",
        "ionic-angular": "3.5.0",
        "ionic-gallery-modal": "^0.1.1",
        "ionic-native": "2.2.3",
        "ionic2-calendar": "^0.2.4",
        "ionic2-rating": "0.0.12",
        "ionicons": "3.0.0",
        "rxjs": "5.4.0",
        "sw-toolbox": "3.6.0",
        "typings": "1.3.1",
        "underscore": "^1.8.3",
        "zone.js": "0.8.12",
        "com.megster.cordova.FileChooser": "http://github.com/don/cordova-filechooser.git",
        "cordova-plugin-camera": "~2.4.0",
        "cordova-plugin-file": "~4.3.2",
        "cordova-plugin-file-transfer": "~1.6.2",
        "cordova-plugin-splashscreen": "~4.0.2",
        "cordova-plugin-whitelist": "~1.3.2",
        "ionic-plugin-keyboard": "~2.2.1",
        "phonegap-plugin-push": "1.8.2"
    },
    "devDependencies": {
        "@ionic/app-scripts": "2.0.0",
        "@ionic/cli-plugin-cordova": "1.4.1",
        "@ionic/cli-plugin-ionic-angular": "1.3.2",
        "typescript": "2.3.4"
    },
    "cordovaPlugins": [
        "cordova-plugin-console",
        "cordova-plugin-statusbar",
        "cordova-plugin-whitelist",
        "cordova-plugin-device",
        "cordova-plugin-splashscreen",
        "ionic-plugin-keyboard"
    ],
    "cordovaPlatforms": [
        "ios",
        {
            "platform": "ios",
            "version": "",
            "locator": "ios"
        }
    ],
    "description": "Yugma is a school quality management App for schools and provides a better interface between parent and teachers.",
    "cordova": {
        "plugins": {
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-camera": {},
            "com.megster.cordova.FileChooser": {},
            "cordova-plugin-file": {},
            "cordova-plugin-file-transfer": {},
            "cordova-plugin-whitelist": {},
            "ionic-plugin-keyboard": {},
            "phonegap-plugin-push": {
                "SENDER_ID": "562555006958"
            }
        }
    }
}

Config.xml:

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.demo.test" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Yugma-Parent</name>
    <description>Yugma is a school quality management App for schools and provides a better interface between parent and teachers.
  </description>
    <author email="test@gmail.com" href="http://www.nxtlifetechnologies.com/">
    NxtLife Team
  </author>
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
        <preference name="android-targetSdkVersion" value="23" />
        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
        <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
        <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
        <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
        <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
        <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
        <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
        <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
        <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
        <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <icon height="57" src="resources/ios/icon/icon.png" width="57" />
        <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
        <icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
        <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
        <icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
        <icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
        <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
        <icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
        <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
        <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
        <icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
        <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
        <icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
        <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
        <icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
        <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
        <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
        <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
        <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
        <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
        <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
        <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
        <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
        <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
        <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
        <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
        <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
        <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
    </platform>
    <preference name="webviewbounce" value="false" />
    <preference name="UIWebViewBounce" value="false" />
    <preference name="DisallowOverscroll" value="true" />
    <preference name="android-minSdkVersion" value="16" />
    <preference name="android-targetSdkVersion" value="23" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <preference name="FadeSplashScreenDuration" value="300" />
    <preference name="SplashScreenDelay" value="3000" />
    <preference name="SplashScreen" value="screen" />
    <preference name="AutoHideSplashScreen" value="false" />
    <preference name="orientation" value="portrait" />
    <preference name="AndroidPersistentFileLocation" value="Compatibility" />
    <feature name="StatusBar">
        <param name="ios-package" onload="true" value="CDVStatusBar" />
    </feature>
    <icon src="resources/android/icon/drawable-xhdpi-icon.png" />
    <allow-navigation href="http://192.168.0.21:8100" />
    <plugin name="com.megster.cordova.FileChooser" spec="http://github.com/don/cordova-filechooser.git" />
    <plugin name="cordova-plugin-camera" spec="~2.4.0" />
    <plugin name="cordova-plugin-file" spec="~4.3.2" />
    <plugin name="cordova-plugin-file-transfer" spec="~1.6.2" />
    <plugin name="cordova-plugin-splashscreen" spec="~4.0.2" />
    <plugin name="cordova-plugin-whitelist" spec="~1.3.2" />
    <plugin name="ionic-plugin-keyboard" spec="~2.2.1" />
    <plugin name="phonegap-plugin-push" spec="1.8.2">
        <variable name="SENDER_ID" value="************" />
    </plugin>
</widget>

And i just build apk using ionic cordova build android --prod and it takes 13 seconds.
Now what should i do ???

Thank you

#16

@fdom Please check:

Ionic Info:

[tushar@tushar-angularjs Parent (copy)]$ ionic info

global packages:

    @ionic/cli-plugin-proxy : 1.3.2
    @ionic/cli-utils        : 1.5.0
    Cordova CLI             : 7.0.1 
    Ionic CLI               : 3.5.0

local packages:

    @ionic/app-scripts              : 2.0.0
    @ionic/cli-plugin-cordova       : 1.4.1
    @ionic/cli-plugin-ionic-angular : 1.3.2
    Cordova Platforms               : android 6.1.2 browser 4.1.0
    Ionic Framework                 : ionic-angular 3.5.0

System:

    Node       : v6.10.3
    OS         : Linux 4.9
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
    npm        : 3.10.10 

Package.json:

{
    "name": "Yugma-Parent",
    "author": "NxtLife Team",
    "homepage": "http://www.nxtlifetechnologies.com/",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "lint": "ionic-app-scripts lint",
        "ionic:build": "ionic-app-scripts build",
        "ionic:serve": "ionic-app-scripts serve",
        "postinstall": "typings install"
    },
    "dependencies": {
        "@angular/common": "4.1.3",
        "@angular/compiler": "4.1.3",
        "@angular/compiler-cli": "4.1.3",
        "@angular/core": "4.1.3",
        "@angular/forms": "4.1.3",
        "@angular/http": "4.1.3",
        "@angular/platform-browser": "4.1.3",
        "@angular/platform-browser-dynamic": "4.1.3",
        "@angular/platform-server": "2.2.1",
        "@ionic-native/camera": "^3.14.0",
        "@ionic-native/core": "3.12.1",
        "@ionic-native/file": "^3.4.4",
        "@ionic-native/file-chooser": "^3.4.4",
        "@ionic-native/keyboard": "^3.6.1",
        "@ionic-native/splash-screen": "^3.12.1",
        "@ionic-native/status-bar": "3.12.1",
        "@ionic-native/transfer": "^3.4.4",
        "@ionic/storage": "2.0.1",
        "angular2-moment": "^1.0.0-beta.rc.1",
        "intl": "^1.2.5",
        "ionic-angular": "3.5.0",
        "ionic-gallery-modal": "^0.1.1",
        "ionic-native": "2.2.3",
        "ionic2-calendar": "^0.2.4",
        "ionic2-rating": "0.0.12",
        "ionicons": "3.0.0",
        "rxjs": "5.4.0",
        "sw-toolbox": "3.6.0",
        "typings": "1.3.1",
        "underscore": "^1.8.3",
        "zone.js": "0.8.12",
        "com.megster.cordova.FileChooser": "http://github.com/don/cordova-filechooser.git",
        "cordova-plugin-camera": "~2.4.0",
        "cordova-plugin-file": "~4.3.2",
        "cordova-plugin-file-transfer": "~1.6.2",
        "cordova-plugin-splashscreen": "~4.0.2",
        "cordova-plugin-whitelist": "~1.3.2",
        "ionic-plugin-keyboard": "~2.2.1",
        "phonegap-plugin-push": "1.8.2"
    },
    "devDependencies": {
        "@ionic/app-scripts": "2.0.0",
        "@ionic/cli-plugin-cordova": "1.4.1",
        "@ionic/cli-plugin-ionic-angular": "1.3.2",
        "typescript": "2.3.4"
    },
    "cordovaPlugins": [
        "cordova-plugin-console",
        "cordova-plugin-statusbar",
        "cordova-plugin-whitelist",
        "cordova-plugin-device",
        "cordova-plugin-splashscreen",
        "ionic-plugin-keyboard"
    ],
    "cordovaPlatforms": [
        "ios",
        {
            "platform": "ios",
            "version": "",
            "locator": "ios"
        }
    ],
    "description": "Yugma is a school quality management App for schools and provides a better interface between parent and teachers.",
    "cordova": {
        "plugins": {
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-camera": {},
            "com.megster.cordova.FileChooser": {},
            "cordova-plugin-file": {},
            "cordova-plugin-file-transfer": {},
            "cordova-plugin-whitelist": {},
            "ionic-plugin-keyboard": {},
            "phonegap-plugin-push": {
                "SENDER_ID": "562555006958"
            }
        }
    }
}

Config.xml:

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.demo.test" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Yugma-Parent</name>
    <description>Yugma is a school quality management App for schools and provides a better interface between parent and teachers.
  </description>
    <author email="test@gmail.com" href="http://www.nxtlifetechnologies.com/">
    NxtLife Team
  </author>
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
        <preference name="android-targetSdkVersion" value="23" />
        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
        <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
        <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
        <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
        <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
        <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
        <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
        <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
        <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
        <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <icon height="57" src="resources/ios/icon/icon.png" width="57" />
        <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
        <icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
        <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
        <icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
        <icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
        <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
        <icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
        <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
        <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
        <icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
        <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
        <icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
        <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
        <icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
        <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
        <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
        <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
        <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
        <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
        <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
        <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
        <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
        <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
        <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
        <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
        <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
        <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
    </platform>
    <preference name="webviewbounce" value="false" />
    <preference name="UIWebViewBounce" value="false" />
    <preference name="DisallowOverscroll" value="true" />
    <preference name="android-minSdkVersion" value="16" />
    <preference name="android-targetSdkVersion" value="23" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <preference name="FadeSplashScreenDuration" value="300" />
    <preference name="SplashScreenDelay" value="3000" />
    <preference name="SplashScreen" value="screen" />
    <preference name="AutoHideSplashScreen" value="false" />
    <preference name="orientation" value="portrait" />
    <preference name="AndroidPersistentFileLocation" value="Compatibility" />
    <feature name="StatusBar">
        <param name="ios-package" onload="true" value="CDVStatusBar" />
    </feature>
    <icon src="resources/android/icon/drawable-xhdpi-icon.png" />
    <allow-navigation href="http://192.168.0.21:8100" />
    <plugin name="com.megster.cordova.FileChooser" spec="http://github.com/don/cordova-filechooser.git" />
    <plugin name="cordova-plugin-camera" spec="~2.4.0" />
    <plugin name="cordova-plugin-file" spec="~4.3.2" />
    <plugin name="cordova-plugin-file-transfer" spec="~1.6.2" />
    <plugin name="cordova-plugin-splashscreen" spec="~4.0.2" />
    <plugin name="cordova-plugin-whitelist" spec="~1.3.2" />
    <plugin name="ionic-plugin-keyboard" spec="~2.2.1" />
    <plugin name="phonegap-plugin-push" spec="1.8.2">
        <variable name="SENDER_ID" value="************" />
    </plugin>
</widget>

And i just build apk using ionic cordova build android --prod and it takes 13 seconds.
Now what should i do ???

Thank you

#17

So upgrading was no problem at all and boot time is already down to 13 seconds?
Congratulations! That is awesome.
What work was needed for the upgrade?

Did you already implement any lazy loading?

1 Like
#18

@Sujan12 I just follow Ionic2 to Ionic3 link and updates my code according to that. and its working fine.

Before that i uninstall ionic v2.2.0 and run npm install ionic cordova -g and also update node and npm version.

It’s update ionic, ionic cli, app-script and cordova globally in my system.

Thank you @Sujan12, @reedrichards and @fdom.

I am too much happy :innocent: but still worrying about 13 seconds :slight_smile:

I am going to follow Lazy Loading link. Should I do it or not? And if I do it what will be the benifit of it? If you have any other link or resources to achieve lazy loading for the quick boot time?

Please help me out in this issue as I am stuck since long. Thanks a lot.

2 Likes
#19

@Dhyanandra cool to hear your app boot fast, but still, I’m agree, 13 seconds is a lot

About lazy loading, if you use the same components in many pages, I would advice, but that’s my point of view, not to use lazy loading. Right now, in such a cases, the code gonna be included multiple times in the build which could have some side effect and gonna increase the size of the built app.

If you don’t use components or don’t use the same components in my pages, yep why not using lazy loading.

But if I was you, first, I would search deeper where are these 13 seconds consumed. Had you have a look to your Xcode logs? How much time does it take till you see the entry “Device Ready” in the logs?

#20

wow sounds a great improve but still little slowly (13 secs) so try to copy my config.xml attributes for the splashscreen in your config.xml and override yours.

Im not using lazy loading and my app boot time is around 3secs, maybe cause you have more plugins :thinking:

Try changing the config.xml file and then use lazy loading and share results :blush: