简体   繁体   English

react-native 尺寸不缩小

[英]react-native size doesn't shrink

Trying to make a smaller APK, currently the size is 21 MB.尝试制作更小的 APK,目前大小为 21 MB。 Hoping to reduce it to 10MB.希望减少到10MB。

I do this inside android/app/build.gradle , but it doesn't reduce, I just want ARM support for now:我在android/app/build.gradle中执行此操作,但它并没有减少,我现在只想要 ARM 支持:

splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "arm64-v8a"
        }
    } 

Try this, I hope this will helps you.试试这个,希望对你有帮助。

Open up android/app/build.gradle打开 android/app/build.gradle

Set def enableProguardInReleaseBuilds = true this would enable Progaurd to compress the Java Bytecode.设置 def enableProguardInReleaseBuilds = true 这将使 Progaurd 能够压缩 Java 字节码。 This reduces the app size by a tad bit这会稍微减少应用程序的大小

Set def enableSeparateBuildPerCPUArchitecture = true.设置 def enableSeparateBuildPerCPUArchitecture = true。 Android devices support two major device artitectures armebi and x86. Android 器件支持两种主要器件结构 armebi 和 x86。 By default RN builds the native librariers for both these artitectures into the same apk.默认情况下,RN 将这两种艺术的原生库构建到同一个 apk 中。

more information to 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM