Flutter The sandbox is not in sync with the Podfile.lock.

前因

在将Flutter项目集成到原生iOS项目中报错:The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation. 。根据描述,是podfile.lock 文件没有同步,flutter的集成包中和Xcode中的文件存在差异。并且还友好的给出了解决方案:pod install。然而并没有解决问题。

解决方案

1、关闭Flutter module工程,关闭Xcode工程,删除podfile.lock文件,删除xxx.xcworkspace 文件,命令如下:

bash 复制代码
cd xxx/project
rm -rf podfile.lock
rm -rf xxx.xcworkspace
//如果不希望更新本地仓库推荐使用
pod install --no-repo-update
//pod install

然后重新打开Xcode,清除缓存。如果可以正常运行,则表示问题已处理。

大多时候这样是不能解决问题的,哈哈。。。

2、打开Xcode->选中工程->选中Project->Info->Configurations。

可以看到下面有两栏,对应debug和release,如果右边的Configurations Set上显示的是None,那么把它改成Pods-xxx.debug 。同理Release 也选上。

然后再次跑起来,不出意外,可以正常运行。

3、找到项目文件的根目录下的Podfile.lock文件,然后再找到Pods文件夹下的Manifest.lock文件,接着复制项目根目录下的Podfile.lock文件的全部内容,直接替换Pods文件夹下的Manifest.lock文件内容,然后重新运行项目,就解决问题了。

4、分享其他文章解决问题的步骤

sql 复制代码
步骤I. 
Project Cleanup 
In the project navigator, select your project Select your target 
Remove all libPods*.a in Linked Frameworks and Libraries 
步骤II. Update CocoaPods Launch Terminal and go to your project directory. 
Update CocoaPods using the command pod install

至此,The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation,问题应该已经解决,Flutter还是有很多坑需要注意的,需要多积累多记录。

相关推荐
茶底世界之下3 天前
为什么预览、录制、离线导出不能共享同一个背压策略?
ios·swift
2501_916007473 天前
苹果商店iOS应用上架费用全面解析:开发者计划与审核费用计算
android·ios·小程序·https·uni-app·iphone·webview
君赏3 天前
棉宇宙 Flutter 热更新是如何落地的
flutter
2501_916008893 天前
如何实现iOS App代码混淆:SwiftShield使用指南
android·ios·小程序·https·uni-app·iphone·webview
2501_915909063 天前
移动端开发工具链怎么组合比较好,iOS、Android、跨端三套配置方案
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
恋猫de小郭3 天前
AndroidX 新增 Security State ,支持可编程的系统安全状态查询
android·前端·flutter
zihan5183 天前
自己做软件日记9/21 得到了一个良好的文件结构框架
后端·flutter·前端框架·android studio
2501_916008893 天前
怎么用 Godot 导出 iOS 应用并上架 App Store?签名字段该填什么?
android·ios·小程序·https·uni-app·iphone·webview
2501_915918413 天前
iOS编程用什么软件好?主流工具Xcode、AppCode、CodeRunner与新兴快蝎对比
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
终端安全笔记4 天前
iOS 27 之后「策略空转」:设备升级不报错,但旧策略不再管它
android·网络·安全·ios·智能手机