Flutter 在Xcode中運行IOS, 遇到的問題(The sandbox is not in sync with the Podfile.lock)

最近遇到了個問題 就是在xcode 中運行flutter 的ios 項目 ,然後發現了個問題就是 

diff: /../Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.

然後也是網上搜了很久 各種解決方式  比如下面這種然而 我試了一下沒什麼卵用 命名都 install 成功了 

//先把項目的Myproject.workspeace刪除
rm -rf MyProject.xcworkspace
//再重新pod 
pod install

最後我發現在pod install的時候,終端會有這麼兩個提示:

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Coding_iOS` to `Pods/Target Support Files/Pods-Coding_iOS/Pods-Coding_iOS.debug.xcconfig` or include the `Pods/Target Support Files/Pods-Coding_iOS/Pods-Coding_iOS.debug.xcconfig` in your build configuration.

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Coding_iOS` to `Pods/Target Support Files/Pods-Coding_iOS/Pods-Coding_iOS.release.xcconfig` or include the `Pods/Target Support Files/Pods-Coding_iOS/Pods-Coding_iOS.release.xcconfig` in your build configuration.

然後通過這個 又找了半天 發現有的人是修改了項目info 中的一個配置 

有的說要改成none。有的說改成Pods-Runner.debug. 我這裏改成了後者 ,開心的發現沒有報上面那個錯了。但是我運行以後又又又發現一個錯誤

/bin/sh: /packages/flutter_tools/bin/xcode_backend.sh: No such file or directory

what happend ?? 我運行一個flutter 裏的ios 就這麼難嗎。於是我又又又 搜了 半天 

有的說看看 Generated.xcconfig 裏面FLUTTER_APPLICATION_PATH 以及FLUTTER_ROOT的路徑對不對 ,我看了一下是對的 那麼爲啥還是 會報錯呢 最後我發現在項目的buildsetting 中 debug 這裏沒有東西 所以 運行的時候找不到路徑

這裏面 debug 後面一開始是沒東西的 後來我加了配置 然後就不報錯了。然而當我開心的點擊 小三角時。又又又出現了問題

於是我找到了info.plist 看看cfbundleversion。是個啥玩意 好像是要一個版本號。於是我又去項目的buildsettings 中看了一下

發現了debug 下好多東西都是空的

於是我按照profile 的都給debug 安排上 。然後product -> clean 一下 (很重要) 然後點起小三角 發現成功運行 很ok 。

ZBC!無情哈拉少兒!

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章