ios - 异常 : CocoaPods not installed or not in valid state

标签 ios xcode flutter visual-studio-code cocoapods

我无法解决在 Debug模式下从 Visual Studio Code 启动 Flutter 应用程序的以下错误。
错误:

Launching lib/app/main_dev.dart on Austris iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: P4CFB6V724
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:
  sudo gem install cocoapods

Exited (sigterm)
Exception: CocoaPods not installed or not in valid state.
Cocoapods 在那里,我现在可能已经重新安装了几十次。两者 - gem 和酿造。似乎没有任何效果。我试过 flutter clean ,重新安装flutter,降级flutter版本(低至1.17.5)。
该错误似乎仅在我通过 Xcode 归档 iOS 应用程序后发生。
Flutter 医生也没有提示任何事情。
奇怪的是我可以通过命令行启动应用程序(使用 flutter run )。
这是flutter doctor -v输出

[✓] Flutter (Channel stable, 1.20.4, on Mac OS X 10.15.6 19G2021, locale en-LV)
    • Flutter version 1.20.4 at /Users/austris/Documents/DEV/flutter
    • Framework revision fba99f6cf9 (34 hours ago), 2020-09-14 15:32:52 -0700
    • Engine revision d1bc06f032
    • Dart version 2.9.2

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/austris/Library/Android/sdk
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /Users/austris/Library/Android
    • ANDROID_SDK_ROOT = /Users/austris/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.7)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.7, Build version 11E801a
    • CocoaPods version 1.9.3

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 43.0.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.49.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.14.1

[✓] Connected device (1 available)
    • Austris iPhone (mobile) • ios • iOS 13.7

最佳答案

考虑重新安装 vscode .它会自动解决您的问题。快乐编码!

关于ios - 异常 : CocoaPods not installed or not in valid state,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63916913/

相关文章:

ios - 如何用新数据刷新 UItableViewcell

flutter - FlatButton 的 onPressed 为一个变量打印 null,该变量的值是从 TextField 的 onChange 函数设置的

flutter - Flutter中如何使用Column在屏幕中间显示文本?

ios - 无法运行 iOS 代码

ios - 按嵌套对象中的字符串过滤 NSArray

objective-c - 4.4 中的新 Objective-c 文字

flutter - 下拉选框保持选择

ios - ITMS-90078 : Missing Push Notification Entitlement

objective-c - XCode 4 从 CoreData 中的实体生成类

ios - 使用 getcov 和 lcov 的 xcode7 代码覆盖率