IONIC Android Apk 文件大小太大了!如何减少Android应用程序的大小? [英] IONIC Android Apk File size Way Too Big ! how to decrease the size of app for android?

查看:47
本文介绍了IONIC Android Apk 文件大小太大了!如何减少Android应用程序的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用 ionic 开发了该应用程序,现在在生成 android APK 文件时,它的大小变得太大了.

I have developed the app using ionic and now while generating the android APK file its size getting way too big.

在API集成之前文件大小4.8MB一旦我开始API集成我只修改了10页然后APK文件大小变成71 MB

before the API integration The File Size Was 4.8MB once I Started API Integration I just Modified 10 Pages Then The APK File Size became 71 MB

我使用过的 Cordova 插件

cordova-plugin-console 
cordova-plugin-datepicker
cordova-plugin-device
cordova-plugin-network-information
cordova-plugin-splashscreen
cordova-plugin-statusbar
cordova-plugin-whitelist
cordova-plugin-x-socialsharing
cordova-sqlite-storage
es6-promise-plugin
ionic-plugin-keyboard

我解压了 APK 文件以了解我调查的内容assets/www/文件夹中的build文件夹重357MB,包含js文件和MAP文件

I unzipped the APK file to know what's Happening I Looked Into into The build Folder in assets/www/ folder weighing 357MB and it contains js files and MAP files

WWW 中包含 Css 文件的 Rest Assets 文件夹为 4.5 MB

the Rest Assets folder In WWW which contains the Css File is Of 4.5 MB

如何减小android apk的app大小?

how to decrease the size of app for android apk?

推荐答案

在构建用于生产的 apk 时,您应该使用 --prod 标志.它通过压缩文件来最小化大小.

You should use --prod flag while building apk for production. It minimizes the size by compressing the files.

ionic build android --prod --release

这篇关于IONIC Android Apk 文件大小太大了!如何减少Android应用程序的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆