【Flutter小技巧03】-- 常见报错记录

1,675 阅读1分钟

小知识,大挑战!本文正在参与“程序员必备小知识”创作活动。

本文已参与「掘力星计划」,赢取创作大礼包,挑战创作激励金。

Flutter小技巧01】--- TextField文本垂直居中
【Flutter小技巧02】--- Flutter环境变量配置

1、M1 执行pod报错

解决方案:sudo arch -x86_64 gem install ffi
//第一次 需要 如下 后面 直接 pod install 就可以了
arch -x86_64 pod install
终端勾选 在这里插入图片描述

2、pull_to_refresh Error: No named parameter with the name ‘keyboardDismissBehavior‘

解决方案:导入 导入插件 pull_to_refresh: ^1.6.4 报错解决方案 改成 pull_to_refresh: 1.6.3 记住 不要^ 固定写死版本即可。 不然你写pull_to_refresh: ^1.6 出来的还是 pull_to_refresh: 1.6.4 的版本。

3、flutter Could not find the built application bundle at build/ios/iphoneos/Runner.app.

解决方案:flutter Could not find the built application bundle at build/ios/iphoneos/Runner.app. 报这个错的时候 是因为改了app包名 导致,改回 appName 为 Runner. Select Runner->Runner(Target)->Build Settings->Packaging-> "Product Name" change it to Runner.

如果要改app名称 在info.plist Bundle display name这边改就可以了。

4、真机调试,真机不显示问题 a、尝试手机设置重新设置开发者模式, b、退出开发者工具重新打开 c、退出开发者工具,删除lockfile文件。重新打开。 在flutterSDK下,flutter->bin->cache->lockfile. 以上个三个步骤基本可以解决真机不显示问题。

记录小问题,下次不糟心!