Flutter 踩坑之路

周末玩下flutter,遇到好几个问题




一、更新了flutter 后原有工程报错

解决:

二、编译报错  ßCheck Github 项目后sdk版本不一样问题

Running "flutter pub get" in flutter_wanandroid...              Because every version of flutter_test from sdk depends on path 1.6.2 and dio >=3.0.0-dev.1 depends on path ^1.6.4, flutter_test from sdk is incompatible with dio >=3.0.0-dev.1.

So, because flutter_wanandroid depends on both dio ^3.0.3 and flutter_test any from sdk, version solving failed.

解决:

更新  flutter upgrade --force   

          flutter doctor 

          flutter run

如果是新项目可以指定版本

如果出现Waiting for another flutter command to release the startup lock..只要进入flutter sdk目录,然后找到bin/cache/lockfile文件,删除后再运行flutter doctor

升级Flutter
https://www.jianshu.com/p/7cd254b847b7




三、下载Github上开源项目后如果没签名文件记得注释掉release签名相关代码



四、AndroidStudio 更新flutter后发现不能选择IOS模拟器




五、类型问题

原因:该返回widget的地方返回了 state


六、flutter 在As里边运行正常,为啥用xcode打开就编译报错了呐


解决:删除pod 重新 pod install

更新Flutter插件之后记得 pod update


七、生命周期执行顺序:


八、Mac版本和真机调式技巧: 对于高版本IPhone 设备,先升级Mac版本,然后再更新Xcode版本到最新


Mac

九、Sdk路径

https://www.jianshu.com/p/75f5de4deb0b?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

十、Error: 'Router' is imported from both

命名不要和系统关键词设置的一样

你可能感兴趣的:(Flutter 踩坑之路)