【发布时间】:2022-02-17 16:06:02
【问题描述】:
我正在尝试一个响应本机应用程序,它只需要一个电话号码和国家代码。 这个应用程序大小为 60mb。而同样基于 React Native 构建的大型 apk,例如 facebook 和 uber,大小约为 100 mb。
这怎么可能?
我什至也试过这个。
Open up android/app/build.gradle
Set def enableProguardInReleaseBuilds = true this would enable Progaurd to compress the Java Bytecode. This reduces the app size by a tad bit
Set def enableSeparateBuildPerCPUArchitecture = true . Android devices support two major device artitectures armebi and x86. By default RN builds the native librariers for both these artitectures into the same apk.
【问题讨论】:
-
这能回答你的问题吗? React Native initial App size is too large
-
AAB 是在 Play 商店发布时减小尺寸的解决方案。更多信息,请参考:stackoverflow.com/a/60631207/10657559
-
@Thanhal 创建 aab 后大小为 9 mb。但是 java/kotlin 中的类似应用程序是 1-2 mb
-
是的,因为我们正在使用一些初始包来运行 React Native 项目。但是通过比较通用apk的大小和aab之后的大小来看看好的一面
标签: java android react-native google-play