1

I run flutter doctor in my Mac: there comes an issue below:

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.14 18A391, locale
 zh-Hans-CN)
[✗] Android toolchain - develop for Android devices
 ✗ Unable to locate Android SDK.
 Install Android Studio from:
 https://developer.android.com/studio/index.html
 On first launch it will assist you in installing the Android SDK
 components.
 (or visit https://flutter.dev/setup/#android-setup for detailed
 instructions).
 If the Android SDK has been installed to a custom location, set
 ANDROID_HOME to that location.
 You may also want to add it to your PATH environment variable.

But I have installed Android SDK in my Mac this path /Users/delo/software/android-sdk-macosx.

before ask this question I have follow this post to add the /Users/delo/software/android-sdk-macosx in my /etc/paths.d/android-sdk file, and this post add path-to-android-sdk/tools and path-to-android-sdk/platform-tools.

but there is still have this issue.


EDIT-01

This is the echo $PATH:

/Library/Frameworks/Python.framework/Versions/3.5/bin:/Users/delo/.rvm/gems/ruby-2.3.3/bin:/Users/delo/.rvm/gems/ruby-2.3.3@global/bin:/Users/delo/.rvm/rubies/ruby-2.3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/Users/delo/software/android-sdk-macosx:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Wireshark.app/Contents/MacOS:/opt/local/bin:/usr/local/mysql/bin:/usr/local/Cellar/go/1.7.6/bin:/Users/delo/.rvm/bin:/usr/local/sbin:/Users/delo/software/android-sdk-macosx/tools:/Users/delo/software/android-sdk-macosx/platform-tools
asked Dec 26, 2019 at 7:05
5
  • can you post the result of calling echo $PATH here Commented Dec 26, 2019 at 7:11
  • updated it. please check . Commented Dec 26, 2019 at 8:07
  • change last attribute /Users/delo/software/android-sdk-macosx/platform-toolsdelo to /Users/delo/software/android-sdk-macosx/platform-tools Commented Dec 26, 2019 at 8:12
  • Its a multi-copy, it is /Users/delo/software/android-sdk-macosx/platform-tools. Commented Dec 26, 2019 at 8:13
  • try setting ANDROID_HOME Commented Dec 26, 2019 at 8:25

2 Answers 2

1

I see your $PATH have add the ANDROID SDK PATH and its tools and platform-tools PATH, but did not config the flutter PATH, but you can still run flutter doctor command, there should be copy error.

in your case, there must be ANDROID_HOME variable config error,

you should follow the correct way :

append the

export PATH=/path/to/your/flutter/bin:$PATH
export ANDROID_HOME="/path/to/your/android-sdk"
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools

to

then you just source ~/.bash_profile.

answered Dec 26, 2019 at 10:59
Sign up to request clarification or add additional context in comments.

Comments

0

I believe the problem is in the PATH of Android SDK Command-Line Tools and Android SDK Build Tools.

Put the lines at the end of the .bachrc file:

export ANDROID_HOME="/home/XXX/Android/Sdk/"
export PATH="$PATH:${ANDROID_HOME}cmdline-tools/latest/bin/:${ANDROID_HOME}build-tools/33.0.0/:${ANDROID_HOME}platform-tools/"

Note that latest and 33.0.0 must be changed according to your installation.

answered Oct 29, 2022 at 21:26

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.