4

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
3
  • 1
    Reinstall Vscode
    – Amon C
    Sep 16, 2020 at 9:21
  • 1
    @AmonChowdhury that seemed to work, thanks! Sep 16, 2020 at 11:06
  • Then set my answer as correct then.
    – Amon C
    Sep 16, 2020 at 11:27

3 Answers 3

4

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

3
  • 1
    If all the necessary tools(cocoapods etc) installed it automatically initializes the settings while installing vscode. Vscode does not do that automatically if already installed before the tools(cocoapods etc).
    – Amon C
    Oct 2, 2020 at 15:36
  • 2
    Nothing as drastic for me - all I had to do was to restart vscode and it worked - just make sure that it's been killed, not just closed.
    – Rhisiart
    Nov 14, 2020 at 21:23
  • But yah that's nice to know.
    – Amon C
    Nov 16, 2020 at 7:32
0

I'm using a Macbook Air M1.

For me it was the brew version of vs code. Using the apple silicon version provided from microsoft works.

https://code.visualstudio.com/download

0

I had the same problem and solved it with these steps : (prerequisites: install homebrew first. To check if installed, in your terminal, type $ brew -v )

  1. $ sudo gem uninstall cocoapods (skip this part if cocoapods is not installed. command $pod --version , will tell you if it's installed or not)
  2. $ brew install cocoapods
  3. If there's an error 'The brew link step did not complete successfully The formula built,........, command $ brew link --overwrite cocoapods
  4. $ brew reinstall cocoapods
  5. $ flutter run

After this final step, you might get an error asking you to assign platform 'iOS' with version if you have firebase dependency and running flutter run for the first time. To fix this, simply open the Podfile in the iOS folder then uncomment the platform :ios line and change the version to 10.0, for example - platform :ios, '10.0'

My operating system is macOS Big Sur.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.