Reduce apk size


#1

How to reduce apk size of ionic2 ? pls, help me.:grinning:


#2

What is your ionic info output?
How are you building your app, what command are you using?


#3

i used this commant "cordova build --release android"
ionic info id ==>
cli packages: (C:\Users\MIT\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.18.0
ionic (Ionic CLI) : 3.18.0

global packages:

cordova (Cordova CLI) : not installed

local packages:

@ionic/app-scripts : 3.0.0
Cordova Platforms  : android 6.2.3
Ionic Framework    : ionic-angular 3.7.1

System:

Android SDK Tools : 25.2.5
Node              : v6.9.4
npm               : 5.3.0
OS                : Windows 10

Environment Variables:

ANDROID_HOME : C:\Users\MIT\AppData\Local\Android\sdk

Misc:

backend : legacy

#4

Try the correct one:
ionic cordova build android --prod --release

This will first build the Ionic project in production mode, then the Cordova app in release mode.


#5

When i useing this comment , show error

Error: Metadata version mismatch for module E:/ReduceSize/b2b/node_modules/@ionic-native/sqlite/index.d.ts, found version 4, expected 3
at StaticSymbolResolver.getModuleMetadata (E:\ReduceSize\b2b\node_modules@angular\compiler\bundles\compiler.umd.js:25748:34)
at StaticSymbolResolver._createSymbolsOf (E:\ReduceSize\b2b\node_modules@angular\compiler\bundles\compiler.umd.js:25536:46)
at StaticSymbolResolver.getSymbolsOf (E:\ReduceSize\b2b\node_modules@angular\compiler\bundles\compiler.umd.js:25517:14)
at E:\ReduceSize\b2b\node_modules@angular\compiler\bundles\compiler.umd.js:24376:30
at Array.forEach (native)
at extractProgramSymbols (E:\ReduceSize\b2b\node_modules@angular\compiler\bundles\compiler.umd.js:24375:79)
at AotCompiler.analyzeModulesAsync (E:\ReduceSize\b2b\node_modules@angular\compiler\bundles\compiler.umd.js:23931:47)
at CodeGenerator.codegen (E:\ReduceSize\b2b\node_modules@angular\compiler-cli\src\codegen.js:32:14)
at Function.NgTools_InternalApi_NG_2.codeGen (E:\ReduceSize\b2b\node_modules@angular\compiler-cli\src\ngtools_api.js:73:30)
at Object.doCodegen (E:\ReduceSize\b2b\node_modules@ionic\app-scripts\dist\aot\codegen.js:6:51) :grinning:


#6

Then open a new topic with a proper title and description for this please. You have to get this solved.


#7

Thanks:grinning: for your advice i’ll try…


#8

i’ve sovled above error by reducing version of plugin * npm install -s @ionic-native/sqlite@versionnumber…*:grinning: