微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

flutter打包的android包部分手机安装失败flutter run --release命令和flutter build apk命令的区别

如题,直接说原因:

Flutter run --release命令打的包不行,必须要通过build apk(Flutter build apk命令)的方式来

后面android打包都用build apk的命令来打包,这个命令打出的包会大一些,因为包含了更多的支持cpu abi指令集,能适配更多的手机。
Flutter run --release命令打出来的包只是针对你当前插入的手机来执行的包,体积要小很多。
所以以后都用Flutter build apk命令或者android里面的菜单

这种方式打包。

执行打包命令后,提示

Running "Flutter pub get" in newsinenglish... 1.2s
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
To generate an app bundle, run:
Flutter build appbundle --target-platform android-arm,android-arm64,android-x64
Learn more on: https://developer.android.com/guide/app-bundle
To split the APKs per ABI, run:
Flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
Learn more on: https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Running Gradle task 'assembleRelease'...

细看上面的绿色显示的命令,其实还是有很多方式去执行打包的。

原文地址:https://blog.csdn.net/wangyajuncsd/article/details/106946695

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐