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'...

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

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值