Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter not detecting Android SDK

I've been trying to get flutter to detect the Android SDK.

flutter doctor

returns

PS I:\Projects\Flutter\fluttertest\flutterproject> flutter doctor -v
[√] Flutter (Channel beta, v0.1.5, on Microsoft Windows [Version 10.0.16299.248], locale en-US)
• Flutter version 0.1.5 at I:\Source\flutter
• Framework revision 3ea4d06340 (7 days ago), 2018-02-22 11:12:39 -0800
• Engine revision ead227f118
• Dart version 2.0.0-dev.28.0.flutter-0b4f01f759

[!] Android toolchain - develop for Android devices
• Android SDK at C:\NVPACK\android-sdk-windows
• Android NDK location not configured (optional; useful for native profiling support)
• ANDROID_HOME = C:\NVPACK\android-sdk-windows
X Android SDK is missing command line tools; download from "link to google"
• Try re-installing or updating your Android SDK, visit https://flutter.io/setup/#android-setup for detailed instructions.

[√] Android Studio (version 3.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[√] VS Code (version 1.20.1)
• VS Code at C:\Program Files\Microsoft VS Code
• Dart Code extension version 2.9.2

[√] Connected devices (1 available)
• Nexus 6P • 8XV7N16A04000597 • android-arm64 • Android 8.1.0 (API 27)

! Doctor found issues in 1 category.

flutter doctor - output

I've tried downloading the SDK Tools Package and even Installed Android Studio and added it to PATH, but was unable to resolve the issue.
The current Android installation sits in a directory called C:\NVPACK, and although I do remember fiddling with it, I don't remember which program installed it. I'm considering removing it. Any help would be greatly appreciated.

PATH Variable

like image 397
Laserbeak43 Avatar asked Mar 02 '18 11:03

Laserbeak43


4 Answers

Flutter provide command to update our Android SDK path:

Use flutter config --android-sdk <path-to-your-android-sdk-path>

Or just add a variable ANDROID_HOME with your sdk location in user variables

like image 172
Mohammad Avatar answered Nov 13 '22 14:11

Mohammad


Open Android Studio.

Click on Tools go to Sdk manager.

Then click on SDK tools.

enter image description here

Unchecked Hide Obsolete Packages then Check Android SDK Tools.

Then Tools will be install after that you can set the path and check the connectivity. Your problem will resolve.

like image 29
Ahsan Hameed Avatar answered Oct 22 '22 17:10

Ahsan Hameed


It turns out that I had NVIDIA CodeWorks installed. I believe it was part of my VS2017 installation options. I've removed it and modified my ANDROID_HOME Environment Variable and removed all of the variables associated with the NVPACK folder. (thanks to everyone (1) who helped me offsite!)

All good!

like image 4
Laserbeak43 Avatar answered Nov 13 '22 15:11

Laserbeak43


You have to set ANDROID_HOME variable to SDK. create a new variable by the name and set it to the installation directory. make sure SDK is not below 2 subfolders from c drive or any windows root drive.

like image 2
Sushanth Kille Avatar answered Nov 13 '22 16:11

Sushanth Kille