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

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.

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

Flutter doctor on Windows10 is not recognizing the AndroidStudio plugins

Both Flutter and Dart plugins are installed in AndroidStudio (v3.6) but flutter doctor does not seem to be recognizing them.
AndroidStudio is installed via JetBrains Toolbox
Flutter doctor is reporting:
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.720], locale en-AU)
• Flutter version 1.12.13+hotfix.8 at D:\Flutter\sdk
• Framework revision 0b8abb4724 (7 weeks ago), 2020-02-11 11:44:36 -0800
• Engine revision e1e6ced81d
• Dart version 2.7.0
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\tradj\AppData\Local\Android\Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-R, build-tools 29.0.2
• ANDROID_HOME = C:\Users\tradj\AppData\Local\Android\Sdk
• Java binary at: C:\Users\tradj\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\192.6241897\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:\Users\tradj\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\192.6241897
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
I have tried uninstalling and reinstalling AndroidStudio. Plugins are configured in AndroidStudio.
Any help would be appreciated
Flutter doctor in android studio will only work properly after setting up the paths of their sdks in android settings for both: flutter & dart.
Checkout File > Settings > Languages & Frameworks > dart & flutter and set their paths there. It will start working after that.
This works for me.

Option to create a new Flutter project is missing after upgrade of Android Studio (3.4) and Flutter Plugin (38.2.1)

After upgrading Android Studio to (3.4) and my Flutter Plugin to (38.2.1), the option to create a new project is missing from the Android Studio startup screen. I've tried the following things detailed below. Any suggestions to fix this would be greatly appreciated.
Flutter Doctor Summary
[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.14.5 18F132, locale en-US)
• Flutter version 1.7.8+hotfix.4
• Framework revision 20e59316b8 (4 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 28.0.3)
• Android SDK
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.2.1, Build version 10E1001
• CocoaPods version 1.6.1
[✓] iOS tools - develop for iOS devices
• ios-deploy 1.9.4
[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 38.2.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[✓] IntelliJ IDEA Community Edition (version 2019.1)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 34.0.4
• Dart plugin version 191.6183.88
[✓] VS Code (version 1.36.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.2.0
[✓] Connected device (1 available)
• iPhone Xʀ • D5A5B892-EA4E-4632-8562-D5A55B823E71 • ios • com.apple.CoreSimulator.SimRuntime.iOS-12-2 (simulator)
• No issues found!
In Android Studio, verified that Android Studio->Plugins shows Flutter and Dart plugins are enabled.
In Android Studio, verified that Android Studio->Preferences->Languages & Frameworks shows Flutter and Dart are supported.
After upgrade, exited Android Studio and restarted MAC.
As a work around, I'm creating a new project from the command line, and then editing and running the project from Android Studio.

VS code and Android Studio can't find emulator

Android studio and VS code show me both no devices but flutter doctor shows no issues and the flutter run command runs the app fine
Output in Terminal:
flutter doctor -v
[✓] Flutter (Channel beta, v1.3.8, on Linux, locale de_DE.UTF-8)
• Flutter version 1.3.8 at /home/nuggetz/Programme/flutter
• Framework revision e5b1ed7a7f (vor 3 Wochen), 2019-03-06 14:23:37 -0800
• Engine revision f4951df193
• Dart version 2.2.1 (build 2.2.1-dev.0.0 571ea80e11)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /home/nuggetz/Programme/android/
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /home/nuggetz/Programme/android/
• Java binary at: /opt/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.
[✓] Android Studio (version 3.3)
• Android Studio at /opt/android-studio
• Flutter plugin version 34.0.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[✓] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)
• No issues found!
EDIT: when i run in Android Studio Tools > Flutter > flutter doctor I get this output:
/home/nuggetz/Programme/flutter/bin/flutter doctor --verbose
[✓] Flutter (Channel beta, v1.3.8, on Linux, locale de_DE.UTF-8)
• Flutter version 1.3.8 at /home/nuggetz/Programme/flutter
• Framework revision e5b1ed7a7f (vor 4 Wochen), 2019-03-06 14:23:37 -0800
• Engine revision f4951df193
• Dart version 2.2.1 (build 2.2.1-dev.0.0 571ea80e11)
[✗] 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.io/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.
[✓] Android Studio (version 3.3)
• Android Studio at /opt/android-studio
• Flutter plugin version 34.0.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
Process finished with exit code 0
If the status bar reads No Devices Flutter has not been able to discover any connected iOS or Android devices or simulators. You need to connect a device, or start a simulator, to proceed.
The Flutter extension automatically selects the last device connected. However, if you have multiple devices/simulators connected, click device in the status bar to see a pick-list at the top of the screen. Select the device you want to use for running or debugging.
Flutter.dev
just move all sdks from /home/nuggetz/Programme/android/ to /usr/lib/android-sdk

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