Unable to locate android sdk Flutter Mac - android-studio

I am a new user to flutter and i installed android studio and flutter plug in. While running my flutter doctor -v it shows. I don't know how to fix it. help me out. I tried a lot to fix it but nothing helps me
[✗] 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/docs/get-started/install/macos#android-setup
for detailed instructions).
If the Android SDK has been installed to a custom location, set
ANDROID_SDK_ROOT to that location.
You may also want to add it to your PATH environment variable.
[✗] 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.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 34.0.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build
1.8.0_152-release-1248-b01)
[!] Android Studio
• Android Studio at /Users/apple/Developer/flutter/Contents
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
✗ Android Studio not found at /Users/apple/Developer/flutter/Contents
• Try updating or re-installing Android Studio.
[!] Connected device
! No devices available

Please go to Project Structure and solve some errors.
Android Studio -> File -> Project Structure.
Please check that you install dart and flutter plugin in the android studio.
Please install Dart in your system also.

is there local.properties file present in your project, inside android folder ?
if not , then create a local.properties file and put your android sdk path inside it, like in my case
sdk.dir=/Users/tusharpandey/Library/Android/sdk

Related

Android Studio 4.1.2 - Dart And Flutter is not installed in "flutter doctor"

I've recently installed android studio 4.1.2 with flutter 1.22.6
even though I installed flutter and dart plugins in android studio the result of 'flutter doctor' command was as follows.
[√] Flutter (Channel stable, 1.22.1, on Microsoft Windows [Version
10.0.18362.30], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version
30.0.2)
[!] Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
Now for clear error act as below (Steps worked for me):
flutter channel dev
flutter upgrade
flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"
flutter doctor -v
It is a problem in Flutter config detection. If you start Android Studio and plugins installed, you can use it and all functionality will works fine. You can find solutions in issue on GitHub.
It's a bug in the Flutter SDK.
You can ignore it. Everything works as intended.
The reason for getting that error is because of the Android version you are using. If you should run:
flutter doctor -v,
You should get the Android version flutter is trying to check the configuration for.
In my case, it shows Android Studio version 4.1.0 even though i have Android Studio 4.1.2 installed with the required plugins. So, as long as it keeps expecting that Android studio version but with a different version installed, you should be getting same error. So, i think the solution to that is to get the Android version flutter doctor displays or probably wait for the next stable release of flutter that supports Android version 4.1.2.

Flutter plugin not installed when using Android-Studio

Hi I am getting the following error.
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 1.20.2, on Microsoft Windows [Version 10.0.18362.1016], locale en-IN)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[!] Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.48.2)
[√] Connected device (1 available)
! Doctor found issues in 1 category.
I have installed both plugins and everything in environment variable.
I installed Android studio in my custom path, this may be the issue. I have given the current android-studio path using flutter config command.
When I check the Installation path the plugin is not there(flutter and dart). It is installed in C:\Users\AppData\Roaming\Google\AndroidStudio4.1\ path.
So I set that path then shows another error that is, embedded java is not found.
Also I tried copying it to custom path. But no luck.
Thanks for your help
If you are doing everything on vs code having flutter and dart not installed on android studio should not be an issue. You only need android studio to connect to the emulator. I can run my flutter code with both plugins not installed.

Flutter not detecting Android Studio

I have installed flutter correctly on my Ubuntu machine. I have also installed Android Studio and its plugins Flutter and Dart.
Anyway, when I run:
flutter doctor --verbose
I get this output:
[✓] Flutter (Channel stable, 1.20.1, on Linux, locale es_ES.UTF-8)
• Flutter version 1.20.1 at /root/snap/flutter/common/flutter
• Framework revision 2ae34518b8 (hace 5 días), 2020-08-05 19:53:19 -0700
• Engine revision c8e3b94853
• Dart version 2.9.0
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
• Android SDK at /home/AAAA/Android/Sdk
• Platform android-30, build-tools 30.0.1
• Java binary at: /usr/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_265-8u265-b01-0ubuntu2~18.04-b01)
• 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/linux#android-setup
for detailed instructions).
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
My android studio is located on /snap/android-studio/current/android-studio
I have also tried running:
flutter config --android-studio-dir=/snap/android-studio/current/android-studio
And:
flutter config --android-studio-dir=/snap/android-studio
But the result after running flutter doctor is always the same, nothing recognized.
Thanks!
I installed both flutter and android-studio through snap. This fixed it for me:
flutter config --android-sdk="$HOME/Android/Sdk"
flutter config --android-studio-dir="/snap/android-studio/current/android-studio/"
The flutter config command above also worked for me on Windows, but instead I had to use it with no spaces bewtween equal sign and "Path", like below:
flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"
it's work for me, macos:
flutter config --android-studio-dir=/Applications/"Android Studio.app"
when flutter doctor not detect android studio ;
then provide path manually by using following command :
flutter config --android-studio-dir ="your-android-path"
for example:
flutter config --android-studio-dir = "C:\Program Files\Android\Android Studio"
it's work for all OS .
thank you...
flutter wasn't detecting android studio till i did this command:
flutter config --android-studio-dir=/media/hacker/code/android/android-studio
instead of this below which did not work
flutter config --android-studio-dir="media/hacker/code/android/android-studio"
Yeah, so find where snap has installed Android-Studio in your ubuntu:
Go to the root directory where you can find etc, opt, var, usr directories.
Search for "Android". For me it was in "/opt/android-studio-2021.2.1/android-studio"
Open the Terminal and enter:
flutter config --android-studio-dir ="your-android-path"
For me it was like:
flutter config --android-studio-dir ="/opt/android-studio-2021.2.1/android-studio"
Then again run:
flutter doctor

Flutter doctor search location

Where does flutter doctor command look for Android Studio, Visual Studio Code etc. Mine is not detecting VSCode even if I have installed it.
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.2.1, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Android Studio (version 3.3)
[✓] Android Studio (version 3.4)
[!] IntelliJ IDEA Ultimate Edition (version 2019.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[!] Connected device
! No devices available
! Doctor found issues in 2 categories
I don't use Intellij with flutter, so I can simply ignore that warning.
I'm on Manjaro i3 and tried installing both VSCode open source (from Arch Community Repository) and MS branded version (from Arch User Repository) though pacman.
You can add VS Code to your PATH,then it will be solved.
Launch VS Code.
Open the Command Palette (Ctrl+Shift+P) and type 'shell command' to find the Shell Command:
Install 'code' command in PATH command.

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