0

this is my second day on Mac. I just bought the new M1 one and I started installing my apps. I was building some apps with Flutter in Windows. Now I installed Xcode and it's working with iPhone 13 emulator but it's not showing is vsCODE.

This is the output of Flutter Doctor

[flutter] flutter doctor -v
[✓] Flutter (Channel stable, 2.5.3, on macOS 11.3.1 20E241 darwin-arm, locale fr-TN)
    • Flutter version 2.5.3 at /Users/macbookpro/DevTools/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 18116933e7 (il y a 3 semaines), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[✗] Android toolchain - develop for Android devices
    • Android SDK at /Users/macbookpro/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.

[!] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 13.1, Build version 13A1030d
    ! CocoaPods 1.8.4 out of date (1.10.0 is recommended).
        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 upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.

[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code (version 1.61.2)
    • VS Code at /Users/macbookpro/Downloads/Visual Studio Code.app/Contents
    • Flutter extension version 3.28.0

[!] Connected device
    ! No devices available

! Doctor found issues in 4 categories.
exit code 0

2 Answers 2

2

On Mac you still have to start your Emulator in XCode, then after you created your Flutter Project you can open the directory on VS, do not forget to install the Flutter Plugin in VS.

Sign up to request clarification or add additional context in comments.

Comments

2

I had a rough time a new macos user. I tried

sudo gem install cocoapods

then got the response

Building native extensions. This could take a while...
ERROR:  Error installing cocoapods:
    ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20210308-2865-1ivyp7s.rb extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

i had installed cocoapods earlier using homebrew.

So instead this worked, you have to get the latest version first with homebrew.

brew install cocoapods

then

brew link --overwrite cocoapods

flutter doctor -v 

will output

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code (version 1.63.0)
    • VS Code at /Users/myname/Downloads/Visual Studio Code.app/Contents
    • Flutter extension version 3.29.0

[✓] Connected device (2 available)
    • iPhone 12 Pro Max (mobile) • • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
    • Chrome (web)               • chrome                               •
      web-javascript • Google Chrome 96.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.