Matheus
Matheus

Reputation: 3370

Android SDK file not found: adb on MacOSX

On MacOSX, when I run flutter doctor, the following result is shown in the terminal:

[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.14.5 18F132, locale pt-BR)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    ✗ Android SDK file not found: adb.
[✗] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
        sudo xcodebuild -runFirstLaunch
    ✗ CocoaPods not installed.
        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
[✓] Android Studio (version 3.6)
[!] VS Code (version 1.40.2)
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[!] Connected device
    ! No devices available

! Doctor found issues in 4 categories.

The line following error is strange.

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)

✗ Android SDK file not found: adb.

  1. Android SDK is installed
  2. Platform tools are installed
  3. If I run adb devices on my terminal, everything works fine and my device appears.

Any idea on how to fix this?

Upvotes: 0

Views: 2191

Answers (2)

Matheus
Matheus

Reputation: 3370

So I fixed in a very strange way:

Seems like some new version of Android SDK moved adb from /sdk/platform-tools to /sdk/platform-tools/platform-tools

To fix, I've only moved adb from /sdk/platform-tools/platform-tools to /sdk/platform-tools and now it's working.

Upvotes: 2

Loïc Fonkam
Loïc Fonkam

Reputation: 2340

Starting with the less complex fix;

  1. Open vscode, click on the extension tab then search and install flutter extension.
  2. Open the App Store search and install Xcode. It takes a very long time to complete. Clearly your installation is not complete.
  3. If you are sure you have android SDK downloaded, then use the following command to provide the path the android studio. flutter config --android-sdk <path-to-your-android-sdk-path> . Else you can use android studio to download the required Android SDK. See location in picture

enter image description here

  1. Installing Xcode in the App store will install cocaopods. Then try flutter doctor -v and everything will be good.

NOTE: you don't need adb in mac for flutter to compile on android. downloading an Android SDK will install qemu. You will also notice some significate process load while running an Android emulator because of the running qemu process since it is not very optimized fro mac. But that is not an issue you will get use to or just use a real android device. Install Xcode will install all Iphones simulators.

Upvotes: 0

Related Questions