Ionic APP load time and app size

Hi,

I am working on making a small app in ionic2 as starting work on new plate form, I am facing two issue

  1. in Android it’s load time is 15sec, which is really so long …, how can we optimize it?

  2. When I make it’s APK its size is showing 30MB which also huge for a basic app so how can I reduce it?

See if this helps: Android Startup takes 12 Seconds

A basic app have an .apk of 4~5MB and, after installation on thje device, 15MB
Do you have any big asset (in src/asset/) that cannot be compressed, such as images?

Please use the --prod flag, as we state in the app-scripts release changelog.

use ionic build android --prod
apk generated after this will start immediately and will not take 15 sec…

I’am using the --prod flag, but it still taken 15 seconds to load the app, is there another solution?

It’s just a basic pages and not have any images in it yet, When I build APK using this command then it size still same
’platforms/android/build/outputs/apt/android-armv7-debug.apk - 28.2 MB
’platforms/android/build/outputs/apk/android-x86-debug.apk - 33.4 MB

I am really surprised that I just start a demo app and it has this much size, is any advice to reduce apk size

I have already tried this command also “ionic build android --prod”

Do you have crosswalk plugin included in your project? If you do, build will include whole webview in your app. Can you share package.json with us?

My package.json code

{
“name”: “ionic-hello-world”,
“author”: “Ionic Framework”,
“homepage”: “http://ionicframework.com/”,
“private”: true,
“scripts”: {
“i18n”: “ng-xi18n”,
“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.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.7”,
“chart.js”: “^2.4.0”,
“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”
},
“devDependencies”: {
@ionic/app-scripts”: “0.0.47”,
“ionic-minify”: “^2.0.10”,
“ng2-chartjs2”: “^1.2.0”,
“typescript”: “2.0.9”
},
“cordovaPlugins”: [
“cordova-plugin-whitelist”,
“cordova-plugin-console”,
“cordova-plugin-statusbar”,
“cordova-plugin-device”,
“cordova-plugin-splashscreen”,
“ionic-plugin-keyboard”,
“cordova-plugin-crosswalk-webview”
],
“cordovaPlatforms”: [
“ios”,
{
“platform”: “ios”,
“version”: “”,
“locator”: “ios”
}
],
“description”: " An Ionic project"
}

Yes, there it is. Try remove plugin with ionic plugin remove cordova-plugin-crosswalk-webview if you don’t need crosswalk for your app. Then, try build your app again and check startup time and apk file size…

3 Likes

I have a release beta in Google Play. After I found some mistakes in a few words, I modified and resubmit to play Store. The problem is the Update size is as big as the download size.

What is the problem? It suppose to be a small update size.

Are you assuming the Google Play does incremental upload for new app? Well, I think it doesn’t.