Flutter 升级bug解决记录

Flutter 升级bug解决记录,第1张

Flutter 升级bug解决记录

flutter1.6升级至2.10遇到的bug集合


1.安卓真机闪退,不打印任何错误

1.删除.pub-cache/hosted/mirrors.cloud.tencent.com%47dart-pub%47/文件夹下的所有文件
也可能在hosted下的其他文件夹中

2.flutter clean
3.flutter run


2.Cannot run with sound null safety, because the following dependencies

使用flutter run --no-sound-null-safety运行

3.真机运行报错java.lang.RuntimeException: Unable to instantiate activity ComponentInfo

将MainActivity.kt中的package xxxx 改成 package 包名

4.dio升级4.0后,上传文件服务器无法接收到

在3.0时 flutter传参为files:[文件列表],但是升级dio后,后端一直接收不到文件,查找dio的issue后,发现传参需要和后端接收参数完全一致才行
后台接收参数为
public ResultInfo uploadFiles(@RequestParam(value="files[]",required = false) MultipartFile[] files)
至此,传参改为"files[]:[文件列表]"就能接收到了

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/759310.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-01
下一篇 2022-05-01

发表评论

登录后才能评论

评论列表(0条)

保存