这里写目录标题
- ios
- 1、 could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-Runner.debu
- 2、/packages/flutter_tools/bin/xcode_backend.sh: No such file or directory
- 3、 Flutter引用第三方库时报Automatically assigning platform `ios` with version `8.0` on target `Runner`
- 4、 CocoaPods did not set the base configuration of your project because your project already has a custom config set
- 5、flutter常见报错 hasSize 为什么出现 解决办法
- 6、导入第三方出错,VSCode 飘红Target of URI doesn't exist
- 7、更新Flutter 后,重新运行报错:no named parameter with the name ""(一个包内的变量)
- 8、This requires the 'non-nullable' language feature to be enabled.
- 9、 Unhandled Exception: Looking up a deactivated widget's ancestor is unsafe.
ios
1、 could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-Runner.debu
根目录下执行:
flutter clean
flutter pub get
到ios 目录下执行:
pod install
2、/packages/flutter_tools/bin/xcode_backend.sh: No such file or directory
vs 运行不报错,Xcode编译错误,Generated.xcconfig 文件中flutter_root正确
3、 Flutter引用第三方库时报Automatically assigning platform ios
with version 8.0
on target Runner
解决办法:
修改项目里的ios/Podfile文件,
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
platform :ios, '8.0' #增加的内容
4、 CocoaPods did not set the base configuration of your project because your project already has a custom config set
5、flutter常见报错 hasSize 为什么出现 解决办法
出现这个hasSize的报错的原因:
- 父空间没有设置高度,子Widget需要占据尽可能多的地方
如在一个没有高度的Container中,放一个ListView组件,父Widget需要知道子Widget的高度的情况 计算排布
或者一个ListView 套一个ListView
解决方法:
1、给container一个高度,内部listView超出部分滑动。
2、设置内部的listView的属性,使其只展示,不滑动
ListView的属性
shrinkWrap: 是否包裹 true就是要包裹 默认是false
physics: 是否滚动 这样滚动条都看不见了
padding: 内边距
6、导入第三方出错,VSCode 飘红Target of URI doesn’t exist
flutter package get
//然后重启VSCode
7、更新Flutter 后,重新运行报错:no named parameter with the name “”(一个包内的变量)
flutter clean
flutter pub get
// 部分报可能需要更新包的版本
8、This requires the ‘non-nullable’ language feature to be enabled.
Try updating your pubspec.yaml to set the minimum SDK constraint to 2.12.0 or higher, and running ‘pub get’.
9、 Unhandled Exception: Looking up a deactivated widget’s ancestor is unsafe.
报错信息:
Unhandled Exception: Looking up a deactivated widget's ancestor is unsafe.
At this point the state of the widget's element tree is no longer stable. To safely refer to a widget's ancestor in its dispose() method, save a reference to the ancestor by calling inheritFromWidgetOfExactType() in the widget's didChangeDependencies() method.
原因: context 找不到上下文报错,多个dialog嵌套一个消失、另一个出现时,有这个报错
解决:this.context