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

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

问题描述

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

I have developed the app using ionic 3 and now while generating android apk file it 's 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 Interation I just Modified 10 Pages Then The APK File Size became 71 MB

我使用过的科尔多瓦插件

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 unziped 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中的Rest Assests文件夹包含4.5 MB的Css文件

the Rest Assests folder In WWW whis contains the Css File is Of 4.5 MB

如何减小android apk应用程序的大小?

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天全站免登陆