Flutter SDK is not found in the specified location - in Android Studio - android-studio

I am installing Flutter and everything is good except one thing, specified above.
Flutter doctor says this:
$ flutter doctor -v
[√] Flutter (Channel beta, v0.7.3, on Microsoft Windows [Version 10.0.17134.228], locale nl-NL)
• Flutter version 0.7.3 at C:\Flutter\flutter_windows_new\flutter
• Framework revision 3b309bda07 (13 days ago), 2018-08-28 12:39:24 -0700
• Engine revision af42b6dc95
• Dart version 2.1.0-dev.1.0.flutter-ccb16f7282
[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at C:\Users\iwijsman\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 27.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
• All Android licenses accepted.
[√] Android Studio (version 3.1)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 28.0.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
[√] IntelliJ IDEA Community Edition (version 2018.2)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.2
• Flutter plugin version 28.0.4
• Dart plugin version 182.4323.44
[√] Connected devices (1 available)
• Pixel 2 • FA83P1A01724 • android-arm64 • Android 9 (API 28)
• No issues found!
I've added the requested path to variables and in Android studio, the plugins are installed and applied but I still get this error.
please help me, where am I going wrong?

The same problem faced me, but trying the above solution was not helpful. So I tried another thing:
Open File
Select settings from the File menu
Select Languages & frameworks from the left panel
Select Flutter
Then from the right panel choose the location of your flutter SDK
The location of flutter SDK is where you copied or cloned the code. In my case it was like the following:
If the specified location contains the flutter SDK, the version section will contain your flutter version. If not, the version section will not contain any versions and there will be a message in the bottom of the setting dialog saying:
Flutter SDK Is Not Found In The Specified Location
Hope this helps.

The path to the SDK should be to the main Flutter folder (e.g. C:\src\flutter and not to the bin folder as set in the Environment Variable Path.

As mentioned in the message it is optional and only used for specific tasks.
You can install it from Android Studio
Menu > Tools > SDK Manager > Android SDK (left side of the dialog) > SDK Tools (tab)
Ensure that this line is enabled
With [OK] it should be installed.

create an android project and see everything works fine.
if Gradle sync problem with kotline : File -> Settings -> Kotlin Compiler -> Target JVM Version Changing to 1.8 fixed the issue.
If everything run fine as android project then proced:
File -> Settings ->Languages & frameworks->Flutter.
select flutter sdk path as src\flutter and ok
if step 4 not works then select path src\flutter\bin;
Note:if android 10.0 not work then try it with 9.0;

Flutter folder put on dekstop and try to again to set flutter sdk path
check this also..
https://flutter.dev/docs/get-started/install/windows

You need to correctly specify the path of the Flutter installation. To find the path, run in your command line:
flutter doctor -v
The second line of the output should be the path:
[√] Flutter (Channel stable, 2.0.6, on Microsoft Windows [Version 10.0.19041.488], locale en-US)
--- THIS LINE CONTAINS THE PATH---
• Flutter version 2.0.6 at C:\src\flutter\flutter_windows_2.0.6-stable\flutter
• Framework revision 1d9032c7e1 (6 days ago), 2021-04-29 17:37:58 -0700
• Engine revision 05e680e202
...
Enter the path into Android Studio.

Related

Android Studio does not find cocoapods in console

Somehow Android Studio does not find cocoapods, even though it is correctly installed in the system via brew install coocapods. The Android Studio console looks like it doesn't get the correct PATH.
Note: Starting Android Studio through a terminal / iTerm with
open /Applications/Android\ Studio.app
does mitigate the issue, Android Studio then somehow gets the right path. But im wondering how i can archieve the same result for a start directly from the application directory / spotlight-search? Why does Android Studio not resolve the right PATH?
Android Studio Version 2021.1.1, macOS
Console output after click on "Flutter doctor":
/Users/[...]/flutter/bin/flutter doctor --verbose
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-x64, locale de-DE)
• Flutter version 2.8.1 at /Users/[...]/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (6 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/[...]/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
• All Android licenses accepted.
[!] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
✗ 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 see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
...
Starting a terminal in Android Studio or starting iTerm, output:
flutter doctor -v
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-x64, locale de-DE)
• Flutter version 2.8.1 at /Users/[...]/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (6 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/[...]/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2
...
Fixed in Android Studio Bumblebee 2021.1.1.1.21 Patch 1 for Mac.
I just installed the latest ANDROID STUDIO Bumblebee 2021.1.1.1.21 Patch 1 for Mac Intel. I loaded an older FLUTTER app into it and ran, (from the run arrow in the IDE), it against an iPhone 8 Simulator device. The CocoaPods error did NOT appear and the app launched in the Simulator device. It seems to me that this update has fixed that error.
#scrimau wrote the best description of this issue.
Here's some further info:
echo $PATH (using Android Studio's Terminal) produces different results depending on which of the two methods is used to start Android Studio.
The same directories appear in both echo $PATH results, but the directories are shuffled around.
It almost seems like the sequence of directories (as shown by echo $PATH) might have something to do with the different behaviors.
(Sorry: This should have been a comment. I can't find a way to change an answer to a comment. I'll be more careful next time.)
Android Studio Bumblebee 2021.1.1.1.21 Patch 1 seems to have fixed this issue. In the release notes there is a similar issue mentioned:
Issue #216364005: Env variables not sourced when launched from Mac OS X to Monterey Dock

How make a portable Intellij IDEA Ultimate be recognised by Flutter Doctor?

I used to have a portable development environment. Where I have a IntelliJ IDEA Ultimate installed in a External SSD Drive (https://portapps.io/app/intellij-idea-ultimate-portable/). I'm starting to code in Flutter and I having this issue.
When I run "flutter doctor -v", the flutter doesn't recognise the portable version (and I understand, because is not in the default directory).
The question is, how to make flutter doctor recognise this external installation (from zip file)?
I have everything configured correctly, here is my current "flutter doctor -v" output:
[√] Flutter (Channel stable, v1.17.5, on Microsoft Windows [Version 10.0.18363.900], locale en-GB)
• Flutter version 1.17.5 at Z:\SDK\Flutter
• Framework revision 8af6b2f038 (10 days ago), 2020-06-30 12:53:55 -0700
• Engine revision ee76268252
• Dart version 2.8.4
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
• Android SDK at Z:\SDK\Android
• Platform android-30, build-tools 30.0.1
• ANDROID_HOME = Z:\SDK\Android
• Java binary at: Z:\SDK\OpenJDK\bin\java
• Java version OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_252-b09)
• All Android licenses accepted.
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
You're free to use IntelliJ (or any other IDE) for flutter development, but it won't satisfy the checks made by flutter doctor. It's looking specifically for Android Studio. If you want to use IntelliJ then you have to live with flutter doctor's warnings about Android Studio not being installed.
If you want to use a portable version of Android Studio then use the command
flutter config --android-studio-dir "Z:\MyPortableApps\AndroidStudio"
with the path to your portable application.
If you want to see what has been configured then just use flutter config without any parameters. The output starts with a load of usage text but at the end you'll find a section with the heading Settings: listing anything that has been set. A new install won't have anything set and will just use defaults.
To later unset a value use a quoted empty string "" in the same command.

How can I solve below Flutter project creation error?

could not find an option named "androidx". Run 'flutter -h' (or 'flutter -h') for available flutter commands and options.
I create project from android studio 3.6.1.
E:\SOFTWEAR\flutter>flutter doctor -v
[√] Flutter (Channel stable, v1.5.4, on Microsoft Windows [Version 10.0.18362.657], locale en-US)
• Flutter version 1.5.4 at E:\SOFTWEAR\flutter
• Framework revision b593f5167b (11 months ago), 2019-04-22 07:51:33 -0700
• Engine revision ca31a7c57b
• Dart version 2.3.0 (build 2.3.0-dev.0.1 cf4444b803)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at E:\SOFTWEAR\adt-bundle-windows-x86_64-20130219\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = E:\SOFTWEAR\adt-bundle-windows-x86_64-20130219\sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
• All Android licenses accepted.
[√] Android Studio (version 3.6)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 44.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
[√] Connected device (1 available)
• vivo 1951 • b9dad674 • android-arm64 • Android 9 (API 28)
• No issues found!
You can solve that by navigating to your flutter install directory and run
flutter upgrade
There are manual update to be done, but the above command will handle that for you.
You can easily remove this error by update your Dart and Flutter plugin.
Just go to file -> close project
Click on Configure which is shown bottom right in the screen -> Plugins
Search Dart and update and then search flutter and update and restart studio
4.Your problem is resolved you can create fresh project successfully

Flutter cant find android SDK even tho correct path and latest android studio version

I try to debug an android app on my physical device. i could yesterday but today my device wont show up in devices i ran flutter doctor see this error.
Android SDK file not found: adb.
i already tried update the path and check the path it seems normal. i never changed any of the developer settings of my phone (usb debug etc.)
• Flutter version 1.7.8+hotfix.4 at C:\src\flutter_windows_v1.7.8+hotfix.4-stable\flutter
• Framework revision 20e59316b8 (3 weeks ago), 2019-07-18 20:04:33 -0700
• Engine revision fee001c93f
• Dart version 2.4.0
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\Emirhan\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
X Android SDK file not found: adb.
• Try re-installing or updating your Android SDK,
visit https://flutter.dev/setup/#android-setup for detailed instructions.
[√] Android Studio (version 3.4)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 38.2.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[√] VS Code (version 1.37.0)
• VS Code at C:\Users\Emirhan\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.3.0
[!] Connected device
! No devices available
I also added all environment path variable that showed me android SDK not found. Then finally I went to android studio=>Tools=>SDK manager and install or update the SDK version.
C:\Users\...\AppData\Local\Android\Sdk This might help to newbie.

Flutter Doctor (Incorrectly?) Reporting Android Studio Flutter Plugin Not Installed

When I ran flutter doctor it reports that my Android Studio Flutter and Dart plugins are not installed, even though I have the latest installed - and in fact, I can build and deploy a flutter app to a mobile device from Android Studio. I think either my config somewhere isn't correct or flutter doctor has a bug.
When I run flutter doctor -v I get the following:
d:\Dev\Flutter>flutter doctor -v
[√] Flutter (Channel master, v0.5.8-pre.264, on Microsoft Windows [Version 10.0.17134.165], locale en-AU)
• Flutter version 0.5.8-pre.264 at D:\Dev\Flutter\Flutter
• Framework revision b32c77a012 (12 hours ago), 2018-08-07 17:09:14 -0700
• Engine revision 7f083e54fe
• Dart version 2.0.0-dev.69.5.flutter-b04def964c
[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at D:\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• ANDROID_HOME = D:\Android\sdk
• Java binary at: d:\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
• All Android licenses accepted.
[√] Android Studio
• Android Studio at d:\Android\Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• android-studio-dir = d:\Android\Android Studio
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
[√] Connected devices (1 available)
• HTC PN071 • HT485W903981 • android-arm • Android 5.0.2 (API 21)
• No issues found!
I am running Windows 10 using Android Studio 3.1.4. I have switched flutter git branch to master. I have tried uninstall and reinstall the plugins but no success so far.
Below is my Android Studio plugin screenshot:
Go to
Settings > languages and frameworks > flutter
And then on the sdk path browse the directory where you have downloaded flutter. And check to see if it works
Since you are not using the conventional C: drive. Make sure you do not have another version of android studio installed on your system. This would lead flutter to detect a different version without the flutter plugin.
If there is no duplicate installed, there may just be residual files (ie: a backup).
This is just a guess but I hope this helps :)
Just in case someone else ran into this issue, it turns out that my channel was on 'stable' (1.22.1), switching to 'dev' solved the problem. This is a issue, will certanily been fixed in future 'stable' releases.
enter image description here
in case mine i have both android studio and intellij idea installed on my system so i uninstalled intellij idea that fixed my problem
This isn't an issue. Just ignore it. I also only use vscode and get this "issue". Maybe it would be good changing that issue to a info or warning because it could unsettle new flutter developers.

Resources