在更新1.22.5之后 在项目目录下执行 flutter build ios
,报以下错误
Your Xcode project requires migration. See https://flutter.dev/docs/development/ios-project-migration for details.
官方的解决方式是删除项目中的 app.framework和flutter.framework
于是
image.png
image.png
在这两处确定已经没有app.framework 和 flutter.framework
除此之外 如果依然提示之前的报错
再检查 ios/项目/Frameworks 目录下是否还有 app.framework 和 flutter.framework 这两个依赖
image.png
有的话也删除
不出意外到这里已经可以执行命令了
但是用 Product/Archive 打包依然报错
image.png
还是报错 backend.sh不存在, 这个sh是在run script中指定的
路径是 ‘Flutter_Root/xx/xx’, 可能是指定的常量有误
xcode12看看新增的User-Defied设置
之前只有debug配了值 全赋值一下就好了
image.png
到这已经可以正常打包了
不过我们的项目用了extension(A), 之前的依赖方式是错误的, 用A直接依赖主工程的pods, 现在才发现pods是支持共用依赖的
target '主工程名' do
pod 'xxx', '~> x.0'
pod 'xxx', '~> x.0'
use_frameworks!
end
target 'extension_A' do
pod 'xxx', '~> x.0'
pod 'xxx', '~> x.0'
use_frameworks!
end
然后pod update一下 如果被墙了可以配下临时代理
export http_proxy=http://127.0.0.1:10887;
export https_proxy=http://127.0.0.1:10887;
再pod update就可以了
代理记得关
unset http_proxy
unset https_proxy