Flutter打包報(bào)Command PhaseScriptExecution failed with a nonzero exit code

打包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
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容