Flutter——CocoaPods not installed or not in valid state

flutter報錯如下,可能是因為安裝了多個cocoapods.

lib/main.dart:1
Automatically signing iOS for device deployment using specified development team in Xcode project: xxxxxx
Warning: CocoaPods not installed. Skipping pod install.
  CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
  Without CocoaPods, plugins will not work on iOS or macOS.
  For more info, see https://flutter.dev/platform-plugins
To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.

Exception: CocoaPods not installed or not in valid state.
Exited (sigterm)

flutter run又可以跑起來
解決方法:
終端輸入 open /Applications/Android\ Studio.app然后關閉vscode重新打開試試就可以了。
導致這個問題的原因可能是Android Studio的配置問題,或者是有三種可能的資源路徑,你可以將路徑放在如下配置中

  • ~/.profile
  • ~/.zshrc
  • ~/.bashrc
    因此,當你的配置路徑不在上面這三種配置文件中時,就會發生這種情況。無法從啟動板的打開鏈接訪問它。無論何時打開終端會話,所有3條路徑都會自動同步。這就是區別。
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容