Native plugins should not effect the size of ipa/apk and It should not effect the performance of the app

I think so native plugins should not effect the size of ipa/apk and It should not effect the performance of the app.

Think I’m not reading that right. Native plugins do not affect the size of the ipa/apk???

Is that what you meant?


I am also the victim of this thing :smiley:

I am using round about 15 ionic native plugins. My apk size is 24mb.

Why is that so ?

If you unzip the apk (it’s basically a zip file) you can see the breakdown of the content.

The ‘assets’ folder is of particular interest as that is the www folder and has a direct impact on the performance of your startup time.
(slight edit - the assets folder is not just www, contains other stuff but is DEFINITELY of interest)

‘lib’ is the actual native compiled application.

‘res’ are your resources such as icons etc…

If you report back two things:

  • What plugins you have
  • How big the folders mentioned above are

I suspect your compilation is not working with the --prod command as that sounds crazy big.

Plugins which I am using

 "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/app-availability": "^4.1.0",
    "@ionic-native/core": "^3.9.2",
    "@ionic-native/device": "^4.1.0",
    "@ionic-native/file": "^3.5.0",
    "@ionic-native/file-chooser": "^3.5.0",
    "@ionic-native/file-opener": "^3.12.1",
    "@ionic-native/file-path": "^3.5.0",
    "@ionic-native/google-maps": "^3.10.3",
    "@ionic-native/in-app-browser": "^4.1.0",
    "@ionic-native/keyboard": "^3.5.0",
    "@ionic-native/network": "^3.14.0",
    "@ionic-native/photo-library": "^4.1.0",
    "@ionic-native/screenshot": "^3.4.4",
    "@ionic-native/social-sharing": "^4.1.0",
    "@ionic-native/splash-screen": "^3.5.0",
    "@ionic-native/sqlite": "^3.13.0",
    "@ionic-native/status-bar": "^3.9.2",
    "@ionic-native/toast": "^3.5.0",
    "@ionic-native/transfer": "^3.5.0",
    "@ionic-native/unique-device-id": "^4.1.0",
    "@ionic/storage": "^2.0.1",
    "cordova-sqlite-storage": "^2.0.4",
    "cordova-uglify": "^0.2.8",
    "file-saver": "^1.3.3",
    "ionic-angular": "2.0.0",
    "ionicons": "^3.0.0",
    "jssha": "^2.3.0",
    "ng2-password-strength-bar": "^1.1.2",
    "rxjs": "^5.0.1",
    "sha256": "^0.2.0",
    "sw-toolbox": "3.4.0",
    "zone.js": "0.6.26"

lib size is 3.8mb
res size is 7.4mb

That’s a fair few i guess.

On your package.json under ‘scripts’ can you add a new one:

"buildprod": "ionic-app-scripts build --prod",

then run from the command line:

npm run-script buildprod

That will transpile your code into the www folder. Then if you can give us the list of the file sizes in your ‘build’ folder we’ll hopefully see something useful.

Angular 4 has a considerably more efficient build structure, so I would definitely recommend using it instead of 2.2.1.

There are round about 150 native plugins.

Ionic should look into this. Native plugins should not effect the startup time.

Startup time should be same whether the developer use 1 or 10 or 100 native plugins.

This is my point of view. :slight_smile:

Yeah but how should this be possible?
If you do more, it takes more time.
If you want more functionality, your need more code, which takes more space.

You are right.
Size can be ignored but not startup time.

If my app takes round about 10-45 seconds on startup because of multiple plugins which I would be using then what will be the impression of the app user.

Then user will avoid to use my app because of startup time

You can fix that by upgrading your ionic-angular version.
Upgrading Angular versions with it.
Building the app with --prod.
Finding out which of the plugins actually are that big and need the time - and replace them with others.

1 Like

Let’s draw an important distinction here between plugins that are available and plugins that are used, and also between ionic-native shim code and cordova plugins themselves.

Prior to ionic-native 3, the shim code for every plugin was included in your app binary regardless of whether you used them or not. So Ionic did “look into this”, and in v3 that changed. So you only get the ionic-native code that you are actually using.

1 Like

Is there any command to check which plugin can take or is taking too much time on startup or we should see the Xcode console to check which plugin startup time is longer ?

If you don’t get any better answers, one (admittedly rather labor- and time-intensive) idea would be to systematically uninstall sets of plugins, replacing them with NOP mocks, and seeing how that affects what you are interested in.

Before doing any of that, though, I think it would be a better investment to get to Angular 4.

1 Like

Yeah, I don’t know any better options than what @rapropos suggested. Would actually be pretty nice if this existed… Unfortunately I have no idea how this would work :confused: