IOS上面上次代碼運行了,下次不必定能夠繼續運行html
正題,此次我ios
代碼運行後結果以下git
搜了下,都是讓我更新。緩存
我依然記起上個月,我拿着電腦在樓下創業公司蹭網一早上。bash
當時,我去樓下小坐,打開電腦開始寫flutter,我但願能看到漂亮的單身妹子路過。app
而後我輸入flutter run,等待運行,而後報錯了。ide
在這個過程當中,我沒有更新包,沒有修改代碼 而上次我只是關閉電腦 此次我點開運行而已ui
我感受到了窒息this
而後根據錯誤,找到了答案,我不爭氣的按照別人說的開始更新一堆東西,而後能夠了。spa
這一次,我遇到了錯誤,可是不不看提示(看了也沒找到好的解決方案,依然是讓我更新環境)
倔強的我拒絕了,我想知道,到底哪裏出了問題,我正常運行,憑什麼讓我更新環境。
難道我離線就不能開發了麼。
因而開始了探索之旅。
上面那個錯誤,直接看我是找不到好的方案,因而開始修改依賴。
而後每一次修改都會更新,,更新依賴🈶️賊慢,由於我用vscode,vscode裏面的dart插件就是這樣,而後我修改配置拒絕讓它自動更新。
而後發現有了新的錯誤,個人天。。
以前的錯誤被刷走了,我丟失了研究的機會。
而後仍是一堆問題,因而我新建一個flutter項目, 我想知道到底flutter有沒有掛掉。而後發現它正常運行。
flutter create myapp
複製代碼
接着把裏面的依賴一個個加過去,好比把IOS的包加過去,居然同樣,而後我就把安卓也加過去,居然能夠了,可是這時候我沒有添加依賴,我把依賴又加上去,發現掛掉了。
而後運行一下子,flutter整個都掛掉了。 我去新建的項目運行也是。
這時候我發現環境出了問題,找到flutter目錄,(不是項目目錄),裏面會有錯誤信息,也就是.log結尾的問題。看了下錯誤,發現是git的錯誤,說git第一次須要提交。
什麼鬼。
去你的吧,乾脆把git代碼初始化,由於確定有哪裏被改了。
對了 致使flutter環境掛掉的是這個命令 flutter doctor
而之因此我要運行這個是由於,運行run的時候,提示找不到設備,我開了模擬器的,這個沒有問題,我也查看了下設備確實存在,有截圖爲證
看有一個可用的ISO設備, 而運行卻跟我說不存在,,,個人天。
最後呢,跑到git目錄下面執行
git checkout . && git clean -xdf
複製代碼
嗯 能夠了
接着問題尚未解決
我又不死心,既然文件都同樣,憑什麼新建的項目能夠運行,多是哪裏又被修改了,雖然我剛剛複製過去不久,因而一次性複製了安卓 iOS lib代碼 和依賴 而且執行了flutter clean 這時候果真不報莫名其妙的錯誤了,
開始正經以下錯誤。
[!] Automatically assigning platform `ios` with version `8.0` on target
`Runner` because no platform was specified. Please specify a platform for
this target in your Podfile. See
`https://guides.cocoapods.org/syntax/podfile.html#platform`.
Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies. To update the CocoaPods specs, run: pod repo update Error running pod install Error launching application on iPhone Xʀ. 複製代碼
這裏說的是須要安裝ios依賴,須要去ios根目錄安裝
cd ios
pod install --verbose
複製代碼
每次修改完成ios記得執行下 flutter clean
(pod是ios的包管理器命令,包管理器叫CocoaPods)
完成以後
這時候
[!] `<PBXGroup UUID=`97C146E51CF9000F007C117D`>` attempted to initialize an
object with an unknown UUID. `CF3B75C9A7D2FA2A4C99F110` for attribute:
`children`. This can be the result of a merge and the unknown UUID is being
discarded.
複製代碼
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output: ↳ error: /Users/xiexiuyue/Documents/www/flutter/cjyy/ios/Flutter/Debug.xcconfig:1: could not find included file 'Pods/Target Support
Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target 'Runner') error: /Users/xiexiuyue/Documents/www/flutter/cjyy/ios/Flutter/Debug.xcconfig:1: could not find included file 'Pods/Target Support
Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target 'Runner') error: /Users/xiexiuyue/Documents/www/flutter/cjyy/ios/Flutter/Debug.xcconfig:1: could not find included file 'Pods/Target Support
Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target 'Runner') error: /Users/xiexiuyue/Documents/www/flutter/cjyy/ios/Flutter/Debug.xcconfig:1: could not find included file 'Pods/Target Support
Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target 'Runner') error: /Users/xiexiuyue/Documents/www/flutter/cjyy/ios/Flutter/Debug.xcconfig:1: could not find included file 'Pods/Target Support
Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target 'Runner') error: /Users/xiexiuyue/Documents/www/flutter/cjyy/ios/Flutter/Debug.xcconfig:1: could not find included file 'Pods/Target Support
Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target 'Runner') warning: Capabilities for Runner may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the build settings editor. (in target 'Runner') note: Using new build systemnote: Planning buildnote: Constructing build description Could not build the application for the simulator. Error launching application on iPhone Xʀ. 複製代碼
安裝一些插件會致使IOS原生代碼發生變化,這時候若是覺得單單是由於改了而後恢復原來的,繼續執行,若是發現錯誤就clean而後繼續,會發現錯誤繼續。
沒錯,flutter run
、 flutter pub get
都會致使IOS原生代碼的修改,這時候無論怎麼搞,代碼都沒法執行,這時候就得找到上次得代碼了,而後看最近添加的幾個包裏面,排查是哪一個包出現的問題。
--未完,持續更新--