打包Flutter的app Xcode報(bào)錯(cuò)如下
building file list ... rsync: link_stat "/Users/Singer/work/iOSProject/xxx/ios/Flutter/App.framework" failed: No such file or directory (2)
done
sent 29 bytes received 20 bytes 98.00 bytes/sec
total size is 0 speedup is 0.00
rsync error: some files could not be transferred (code 23) at /System/Volumes/Data/SWE/macOS/BuildRoots/e90674e518/Library/Caches/com.apple.xbs/Sources/rsync/rsync-55/rsync/main.c(996) [sender=2.6.9]
Command PhaseScriptExecution failed with a nonzero exit code
由于在命令行執(zhí)行了flutter clean命令,會(huì)把App.framework給刪除
所以導(dǎo)致找不到這個(gè)文件
解決方案
在Thin Binary中embed_and_thin改成build
然后在點(diǎn)擊Product--->Archive進(jìn)行打包

image.png
如果打包出來(lái)后安裝到手機(jī)上 白屏并且會(huì)閃退,請(qǐng)?jiān)侔裈hin Binary中build改成embed_and_thin
再重新Product--->Archive進(jìn)行打包一次
但是這樣的方法始終不太好
最終經(jīng)過(guò)我研究找到方法
下圖中順序可能有關(guān)系

36221623057483_.pic.jpg

image.png
xcrun agvtool next-version -all
這個(gè)next-version是打包的時(shí)候build號(hào) 自動(dòng)加1,無(wú)需在意

image.png