flutter sdk更新后遇到的坑

1、删除catche的坑

[+4379 ms] ../../flutter/.pub-cache/hosted/pub.flutter-io.cn/platform-3.0.0/lib/src/interface/local_platform.dart:46:19: Error: Member not found: 'packageRoot'.
[   +5 ms]       io.Platform.packageRoot; // ignore: deprecated_member_use

sdk里的cache被删后,项目和sdk之间没有了联系,所以需要重新生成flutterModel,再次引入flutter模块

接下来的真机运行起来立马蹦,丢失App.framework

图片.png
Library not loaded: @rpath/App.framework/App
  Referenced from: /private/var/containers/Bundle/Application/6846EA1B-BF42-4929-934B-38363B86B840/TSZG.app/TSZG
  Reason: tried: '/private/var/containers/Bundle/Application/6846EA1B-BF42-4929-934B-38363B86B840/TSZG.app/Frameworks/App.framework/App' (no such file),

重装Cocoapods和ruby-macho:
sudo gem uninstall ruby-macho
sudo gem uninstall cocoapods
sudo gem install ruby-macho
sudo gem install cocoapods

适配空安全

主要是yaml里面插件的适配,别去管warn,先看erro。定义属性加?,非空判断用!

你可能感兴趣的:(flutter sdk更新后遇到的坑)