I am a totally rookie in flutter project development and recently i have run into a tech issue that the flutter can not detect the android simulator even the simulator is on ;
The issue as below:
enter image description here
Flutter console:
F:\Developer\demo>flutter doctor -v
[√] Flutter (Channel beta, v0.7.3, on Microsoft Windows [Version 10.0.17134.228], locale zh-CN)
• Flutter version 0.7.3 at D:\flutter_windows_v0.7.3-beta\flutter
• Framework revision 3b309bda07 (3 months 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 28.0.3)
• Android SDK at D:\Android\android-sdk-windows
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = D:\Android\android-sdk-windows
• Java binary at: D:\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 D:\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)
[!] Connected devices
! No devices available
! Doctor found issues in 1 category.
So, is there anything i am going wrong?
First check if your devices were listed:
In terminal, run the flutter devices command to verify that Flutter
recognizes your connected Android device.
You can follow the installation guide provided in the Flutter documentation:
Windows set-up
Install Android
Studio
Download and install Android Studio.
Start Android Studio, and go through the ‘Android Studio Setup Wizard’. This installs the latest Android SDK, Android SDK
Command-line Tools, and Android SDK Build-Tools, which are required by
Flutter when developing for Android.
Set up your Android
device
To prepare to run and test your Flutter app on an Android device, you
need an Android device running Android 4.1 (API level 16) or higher.
Enable Developer options and USB debugging on your device. Detailed instructions are available in the Android
documentation.
Windows-only: Install the Google USB Driver.
Using a USB cable, plug your phone into your computer. If prompted on your device, authorize your computer to access your device.
n the terminal, run the flutter devices command to verify that Flutter recognizes your connected Android device. By default, Flutter
uses the version of the Android SDK where your adb tool is based. If
you want Flutter to use a different installation of the Android SDK,
you must set the ANDROID_SDK_ROOT environment variable to that
installation directory.
Set up the Android
emulator
To prepare to run and test your Flutter app on the Android emulator,
follow these steps:
Enable VM
acceleration
on your machine.
Launch Android Studio, click the AVD Manager icon, and select Create
Virtual Device…
In older versions of Android Studio, you should instead launch Android Studio > Tools > Android > AVD Manager and select Create Virtual Device…. (The Android submenu is only present when
inside an Android project.)
If you do not have a project open, you can choose Configure > AVD Manager and select Create Virtual Device…
Choose a device definition and select Next.
Select one or more system images for the Android versions you want to emulate, and select Next. An x86 or x86_64 image is
recommended.
Under Emulated Performance, select Hardware - GLES 2.0 to enable hardware
acceleration.
Verify the AVD configuration is correct, and select Finish.
For details on the above steps, see Managing AVDs.
In Android Virtual Device Manager, click Run in the toolbar. The emulator starts up and displays the default canvas for your
selected OS version and device.
Try to check this SO post as well. It is related to your question.
Related
How to install Android SDK commandline tool on a Ubuntu remote server which doesn't have Display/GUI.
When I run, 'flutter upgrade' it gives me the below and I wanted to know if I can use Android SDK commandline tool for resolving the issue.
$flutter upgrade
Upgrading Flutter from /home/yvelumani/flutterDev/sdk/flutter...
Building flutter tool...`
Upgrading engine...
Downloading Android Maven dependencies...
Failed to download the Android dependencies
Downloading Android Maven dependencies... 127.7s (!)
Flutter 1.22.0-10.0.pre.133 • channel master • https://github.com/flutter/flutter.git
Framework • revision 577de1c44e (46 minutes ago) • 2020-09-10 15:55:03 -0700
Engine • revision fee6f9e533
Tools • Dart 2.10.0 (build 2.10.0-110.0.dev)
Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.22.0-10.0.pre.133, on Linux, locale en_US.UTF-8)
[!] 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/linux#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 SDK file not found: adb.
[!] Android Studio (not installed)
[✓] Proxy Configuration
[!] Connected device
! No devices available
! Doctor found issues in 3 categories.
I have downloaded android SDK commandline tool from https://developer.android.com/studio#command-tools. But I am not sure how to install this tool and what path to be chosen as ANDROID_HOME?
NOTE: I am not going/able to use Android Studio for my app development.
Thanks for the help in advance.
Android Studio >> Tools >> SDK Manager >> SDK Tools >> Android SDK Command Line Tools
I've connected Android Phone on my mac via USB. And flutter devices doesn't list my Phone.
I have enabled Developer options in my Phone and set up USB via MTP connection.
Is installing Android Studio a must ?
Here's output of 'flutter doctor'
[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.5 18F132, locale
en-US)
[✗] 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.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
[!] Android Studio (not installed)
[✓] VS Code (version 1.35.1)
[!] Connected device
! No devices available
! Doctor found issues in 3 categories.```
Installing Android SDK (part of Android Studio) is a must. Flutter depends on Android SDK for developing android apps, but you need not use Android Studio as your IDE for flutter.
Or you can just install android-sdk if you don't want the complete Android Studio installation.
I'm running Android studio as an administrator in Windows 10. The AVD is a Nexus 5X API 28. I'm trying to run the flutter demo, but the device drop-box still shows "no devices", it only has the "Open Android Emulator" option, which I clicked to start the AVD:
The output of
flutter doctor -v
is:
[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.17134.407], locale en-US)
• Flutter version 1.0.0 at C:\Users\User\flutter_windows_v1.0.0-stable\flutter
• Framework revision 5391447fae (10 days ago), 2018-11-29 19:41:26 -0800
• Engine revision 7375a0f414
• Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
[√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at C:\Users\User\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.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-1136-b06)
• All Android licenses accepted.
[√] Android Studio (version 3.2)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 31.1.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[!] Connected device
• Device emulator-5554 is not authorized.
You might need to check your device for an authorization dialog.
! Doctor found issues in 1 category.
Unlike in a real phone connected via USB, here there is no authorization dialog when I start the AVD. How can I authorize the phone?
This simple solution worked: Wipe data and Cold Boot.
Didn't work:
Note that in the Terminal of the Android studio, adb is not recognized (following flutter installation instructions). You can add the android SDK location path to the PATH environmental variable just to be able to run adb, but this won't give you more information than flutter doctor -v. The android SDK path should be already in Tools|SDK Manager, which is in my case "C:\Users\User\AppData\Local\Android\Sdk", nothing to do with "android-sdk-windows". Killing and restarting adb didn't work.
Logcat shows the message "Please configure Android SDK" (click on "configure", opens "Project Structure" window). The paths to SDK and default JDK are valid. Installing NDK miscofigured something else, so I uninstalled it and left this path field empty. Under "Project", all Version and Repository fields are empty.
You should add ANDROID_HOME variable to your class_path
set ANDROID_HOME=C:\<installation location>\android-sdk-windows
set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
Taken from this
After that call flutter doctor -v and flutter devices
I;ve had this problem for months.
Android Studio 3.2 ( newest version )
Flutter 0.8.2 • channel beta • https://github.com/flutter/flutter.git
Framework • revision 5ab9e70727 (4 weeks ago) • 2018-09-07 12:33:05 -0700
Engine • revision 58a1894a1c
Tools • Dart 2.1.0-dev.3.1.flutter-760a9690c2
Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.8.2, on Mac OS X 10.13.6 17G65, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.2)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
[✓] Android Studio
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] Android Studio (version 3.2)
[✓] IntelliJ IDEA Community Edition (version 2018.1)
[✓] VS Code (version 1.27.2)
[✓] Connected devices (2 available)
Observe that Android Studio has teo plugin issues...
These plugins are installed and I can still compile for iOS and ANDROID using Flutter. But still looking for a solution on OSx
You can just install the Flutter and Dart plugin in Android Studio by following these steps:
Start Android Studio.
Open plugin preferences (Preferences > Plugins on macOS, File >
Settings > Plugins on Windows & Linux).
Select Browse repositories, select the Flutter plugin and click
Install.
Click Yes when prompted to install the Dart plugin.
Click Restart when prompted.
Now run Android Studio.
Run flutter doctor. You should get this output:
The solution is pretty simple. you have to install the Dart plugin in the android studio.
on Mac:
open Android studio.
Preferences.
plugins.
Browse Repositories.
search for dart and install it.
search for flutter and install it.
restart android studio for changes to take place. Now run flutter doctor and your issue will be resolved.
on Windows and Linux:
The path is File>Settings>Plugins and then the rest of the steps are same as above.
I've installed flutter but when I run flutter doctor to verify the installation, I get:-
Android SDK is missing command line tools
I've doubled checked that the command lines are installed.
What do I need to do remove this error?
I've included the full flutter doctor -v output below:-
$ flutter doctor -v
[✓] Flutter (Channel beta, v0.3.1, on Mac OS X 10.13.4 17E202, locale en-AU)
• Flutter version 0.3.1 at /Users/chris/flutter
• Framework revision 12bbaba9ae (2 weeks ago), 2018-04-19 23:36:15 -0700
• Engine revision 09d05a3891
• Dart version 2.0.0-dev.48.0.flutter-fe606f890b
[!] Android toolchain - develop for Android devices
• Android SDK at /usr/local/Caskroom/android-platform-tools/27.0.1
• Android NDK location not configured (optional; useful for native profiling support)
• ANDROID_HOME = /usr/local/Caskroom/android-sdk/3859397
✗ Android SDK is missing command line tools;
• Try re-installing or updating your Android SDK,
visit https://flutter.io/setup/#android-setup for detailed instructions.
[✓] iOS toolchain - develop for iOS devices (Xcode 9.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.3, Build version 9E145
• ios-deploy 1.9.2
• CocoaPods version 1.5.0
[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 24.1.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[✓] IntelliJ IDEA Ultimate Edition (version 2018.1.2)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 24.1.2
• Dart plugin version 181.4668.60
[!] Connected devices
! No devices available
! Doctor found issues in 2 categories.
On Android Studio open SDK Manager.
Go to SDK Tools tab.
Check if Android SDK Command-line Tools is checked. If not, check and apply the changes.
For some reason, after updating flutter and Android Studio, I got this error too. Seems like some new requirement that for some reason wasn't automatically installed.
This fixed it for me.
I think ANDROID_HOME and ANDROID SDK should be pointing to the same path and that is the SDK's root directory.
In my .bashrc (on LINUX), following are
export ANDROID_HOME=/home/myname/Android/Sdk
export PATH=/home/myname/Android/Sdk:$PATH
export PATH=/home/myname/Android/Sdk/platform-tools:$PATH
export PATH=/home/myname/Android/Sdk/tools:$PATH
export PATH=/home/myname/Android/ndk-build:$PATH
Just solved the problem. Here are my system settings:
System variable ANDROID_SDK_ROOT points to my Android SDK dir
In system Path variable, I have sdk/tools, sdk/platform-tools, and /flutter-dir/bin
Also make sure you don't have dulplicated directories. I previously downloaded another platform-tools and add it to Path, so I had to delete it and use the sdk's one.
After changing those things, I close the flutter cmd windows and run flutter doctor on PowerShell. Worked like a charm!
Please download the latest sdk build-tools to solve the problem of Android SDK is missing command line tools