Ad

Exception: CocoaPods Not Installed Or Not In Valid State

I cannot resolve the following error launching Flutter app from Visual Studio Code in debug mode.

The error:

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 are there, I've probably reinstalled them dozens of times by now. Both - with gem & brew. Nothing seems to work. I've tried flutter clean, reinstalling flutter, downgrading flutter versions (as low as 1.17.5). The error seems to happen only after I archive an iOS app through Xcode.

Flutter doctor is also not complaining about anything. The odd thing is that I CAN launch the app via the command line (using flutter run).

Here's flutter doctor -v output


[✓] 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
Ad

Answer

Consider Reinstalling vscode. It will automatically solve your problem. Happy coding!

Ad
source: stackoverflow.com
Ad