Reputation: 281
my problem is this:
I want to connect my app to Firebase. I followed all the steps and did everything according to the instructions. When I tried to debug the app, the following error came up:
When I enter - flutter run - from the terminal, the following happens:
In flutter doctor -v the following comes out:
[✓] Flutter (Channel stable, 1.20.4, on macOS 11.2 20D64, locale de) • Flutter version 1.20.4 at /Users/danielalakin/development/flutter • Framework revision fba99f6cf9 (5 months 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 30.0.2) • Android SDK at /Users/danielalakin/Library/Android/sdk • Platform android-30, build-tools 30.0.2 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.4) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.4, Build version 12D4e • CocoaPods version 1.10.1
[!] Android Studio (version 4.1) • Android Studio at /Applications/Android Studio.app/Contents ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] VS Code (version 1.52.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.19.0
[✓] Connected device (1 available) • iPhone 12 Pro Max (mobile) • C0991E0B-425B-46BD-9DEA-674181136D99 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
And I have the following versions and paths:
$ pod --version: 1.10.1
$ which pod: /usr/local/bin/pod
$ which gem: /Users/danielalakin/.rvm/rubies/ruby-3.0.0/bin/gem
$ which ruby: /Users/danielalakin/.rvm/rubies/ruby-3.0.0/bin/ruby
Do you know how I can solve this problem?
PS: I work on Visual Studio Code and XCode. I use MacOS Big Sur Version 11.2.
Upvotes: 27
Views: 38102
Reputation: 31
sudo gem uninstall cocoapods sudo gem install cocoapods pod setup
\curl -sSL https://get.rvm.io | bash -s stable source ~/.rvm/scripts/rvm
rvm install ruby-2.7.2 rvm use ruby-2.7.2 --default
gem install cocoapods pod setup
flutter clean flutter pub get
cd ios pod install --repo-update cd ..
Rerunning the Application After completely closing and reopening Visual Studio Code and Xcode, running the project again
I applied these and my problem was solved.
Upvotes: 0
Reputation: 11
I was having similar issues with cocoapods, tried installing and uninstalling, ruby and cocoapods nothing worked as the path(executable) was not resolved, this command solved my issue
sudo gem install -n /usr/local/bin cocoapods
Upvotes: 1
Reputation: 11
I fixed it by reinstalling the flutter extension on visual code and restarting the ide.
Upvotes: 0
Reputation: 4900
Run the commands in that order in terminal.
cd /opt/homebrew/bin/
PATH=$PATH:/opt/homebrew/bin
cd
touch .zshrc
echo export PATH=$PATH:/opt/homebrew/bin >> .zshrc
then brew install cocoapods
Don't forget to restart your IDE.
Upvotes: 1
Reputation: 1
For MAC: brew install cocoapods and then navigate to ios and execute 'pod install'. Exit VS Code and Open and run flutter run.
Upvotes: 0
Reputation: 733
This answer will help if anyone is still facing the issue.
If your are not an admin user for your machine, there are possibilities were you will get this error, as you will not able to run SUDO command. If in that case install Cocoapods using
gem install cocoapods --user-install
And then get the exact location using
gem which cocoapods
Once after that based on the shell your using, EX: zsh or bash, Please add the path to the respective support file.
In my case I have added the path (export PATH="/Users/yourName/.gem/ruby/2.6.0/bin:$PATH") in .zshrc file.
Upvotes: 0
Reputation: 194
run this command :
sudo gem install ffi
if on running flutter doctor
, it still says cocoapods not installed then run this command
sudo gem install cocoapods
Upvotes: 0
Reputation: 650
I ran into this problem on Android Studio 4.1.3. Updating to Bumblebee 2021.1.1 Patch 3 solved it for me.
Upvotes: 0
Reputation: 921
For me none of these was helpful, The workaround was opening the Android studio using Terminal rather than GUI
open /Applications/Android\ Studio.app
After that, I can use GUI and there was no problem :)!
you can find more info here:
https://github.com/flutter/flutter-intellij/issues/4981#issuecomment-751443625
Upvotes: 10
Reputation: 9008
Restarting VSCode usually fixes the problem, but make sure to close it completely - Cmd+Q on macOS.
Another thing worth trying is cleaning XCode workspace, this can be done via flutter clean
command.
Upvotes: 7
Reputation: 2616
The only command who work for me is this one :
brew install cocoapods
Upvotes: 25
Reputation: 1162
In my case I had to reinstall cocoa pods but additionally I had to reinstall my Visual Studio Code IDE.
Upvotes: 1
Reputation: 314
if you use Android Studio try restoring the cache in
file -> invalidate cache/restart
Upvotes: 1
Reputation: 287
I had this same error a number of times in the past, and once right after I upgraded to Flutter 2.0.1 just now. The solution for me was always to run (as previously suggested):
sudo gem install cocoapods
then restart my IDE. I use Android Studio, but same should apply to VSCode as well.
Upvotes: 26