[英]How to reduce expo apk size for android?
I have built an app using expo cli and when I run expo build:android its size is 65 mb.我已经使用 expo cli 构建了一个应用程序,当我运行 expo build:android 时,它的大小为 65 mb。 My app consist of only 7-8 screens.I have tried building.aab file but its size is also 62.5 mb.我的应用程序只包含 7-8 个屏幕。我尝试过 building.aab 文件,但它的大小也是 62.5 mb。 Is there any way to get my app <10mb?有什么方法可以让我的应用程序 <10mb?
Yes, you can reduce the size, but not with the expo
.是的,您可以减小尺寸,但不能使用expo
。
The expo
is a development tool, for production, you should use react-native. expo
是开发工具,生产时应使用 react-native。
Migrating to React Native迁移到 React Native
Reducing the size of React Native App (Android)减小 React Native App (Android) 的大小
Set def enableSeparateBuildPerCPUArchitecture = true.设置 def enableSeparateBuildPerCPUArchitecture = true。 Android devices support two major device architectures armebi and x86. Android 器件支持两种主要的器件架构 armebi 和 x86。 By default, RN builds the native libraries for both these architectures into the same apk.默认情况下,RN 将这两种架构的原生库构建到同一个 apk 中。
Reference:参考:
For more information, you can see this tutorial.有关更多信息,您可以查看本教程。 https://medium.com/@aswinmohanme/how-i-reduced-the-size-of-my-react-native-app-by-86-27be72bba640 https://medium.com/@aswinmohanme/how-i-reduced-the-size-of-my-react-native-app-by-86-27be72bba640
You can still achieve a much smaller build size without moving away from Expo, but you will need to use EAS (Expo Application Services) to build your project instead of Expo build.您仍然可以在不离开 Expo 的情况下实现更小的构建大小,但是您需要使用 EAS(Expo Application Services)来构建您的项目,而不是 Expo 构建。
You can find the documentation here: https://docs.expo.dev/build/introduction/ .您可以在此处找到文档: https://docs.expo.dev/build/introduction/ 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.