Ionic cordova build android --prod --release Corrupts the .apk file

When I run ionic cordova build android --prod --release command, it corrupts my release.apk file.

debug.apk file is 15MB, whereas release.apk file is 4.5MB

When I say corrupt, during time of installation it show App Not Installed however debug.apk file gets installed successfully.

Also, when I sign the debug.apk file with certificate using jarsigner and later do zipalign, it also corrupts debug.apk file bringing down file size to 4.5MB.

Not sure what is happening with --release flag

Above all is happening with manual signing. But when I tried the build process with Android Studio, I get the same result.


   Ionic CLI                     : 5.4.4 (C:\Users\Amit\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.11.5
   @angular-devkit/build-angular : 0.801.3
   @angular-devkit/schematics    : 8.1.3
   @angular/cli                  : 8.1.3
   @ionic/angular-toolkit        : 2.1.1


   Capacitor CLI   : 1.3.0
   @capacitor/core : 1.3.0


   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.1.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 7 other plugins)


   cordova-res : 0.8.1
   native-run  : 0.2.9


   NodeJS : v10.13.0 (C:\Program Files\nodejs\node.exe)
   npm    : 6.4.1
   OS     : Windows 10