vs code cannot launch android emulator - flutter

i was just starting with flutter and i was using android studio before and i have an emulator but now i wanted to start with flutter and tried to run the default flutter project but says no device and when i try to connect to the emulator i have it just keeps loading and says "Failed to launch Pixel 3a API 29: Error: Emulator didn't connect within 60 seconds"
tried a lot to fix it but still the same error.
and by the way when i run flutter doctorit displays
Doctor summary (to see all details, run flutter doctor -v):
1.[✓] Flutter (Channel stable, 2.0.2, on Linux, locale en_US.UTF-8)
2.[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
✗ Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/linux#android-setup for more details.
3.[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
4.[✓] Android Studio (version 3.5)
5.[!] Connected device
! No devices available
! Doctor found issues in 3 categories.
thanks in advance.

I have faced this problem before, Try these steps:
Open your android studio, go to avd manager
Now select your emulator, click on dropdown in actions and wipe data
Check whether you have intel x86 emulator accelerator ticked in sdk tools in android studio.
If the problem still persists, you can remove this emulator and install a new one.

Related

Flutter apk not installing

I am unable to install my apk on an android device except only for this apk. I am using the flutter build apk command to generate apk. After sharing apk to some device it was getting app not installed as shown in this..
I am using VSCode and here I am sharing the flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.8.1, on Microsoft Windows [Version 10.0.19043.1466], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.63.2)
[√] Connected device (3 available)
Other apk's are working fine except this one on my device.
Try all these steps:
Make sure that you have enough storage space
Enable the installation from Unknown Sources
Make sure that the APK file isn’t corrupted or incomplete
try to clear cache of package installer and reboot
Check if the app is already installed in your device.
Check if the play protect option is enabled, if it is then turn off it in play store from navigation drawer.
Make sure “applicationId” in build.gradle file is unique.
Just go to the Settings --> Apps --> Click on your App. ---> In App info page at the action bar menu there will be an option called " Uninstall for All users " click that.
This type of issue is occur when you transfer apk file directly via any messaging platform or USB ... Some time it will happen and apk file will corrupt.. So I suggest to create a link for distribution of your app..
You can upload your apk in Google drive or use Firebase App Distribution or just WeTransfer. And Generate the link and then transfer that link....

Flutter 2.5 cannot recognise sdkmmnager, although everything was fine before upgrading

So yesterday i upgraded flutter to 2.5 and flutter doctor said android-licenses status unknown. So, I ran flutter doctor --android-licenses and it says that sdkmanager not found although the previous version which was probably 2.2.3 didn't say anything like that. I did not install cmdline-tools the "android studio" way. I followed a guide and downloaded the android cmdline-tools.zip file, unpacked it inside "android" folder, made a new tools folder (inside android folder) and copied everything from the android folder to the tools folder. Then I set path to sdkmanager, platform-tools and emulator.
After that I installed platform-tools 31.0.0, android-sdk 31.0.0 and an emulator. At that time flutter was able to recognise sdkmanager and it gave no errors. How do i solve this? Did something related to where the sdkmanager should be located change?
The output of flutter doctor:
[✓] Flutter (Channel stable, 2.5.0, on Arch Linux 5.13.13-zen1-1-zen, locale
en_IN.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/linux#android-setup for more
details.
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[!] Android Studio (not installed)
[✓] Connected device (1 available)
and the output of flutter doctor --android-licenses:
cmdline-tools are installed to resolve this.
Also i can run the default app just fine.
I am running linux.
For Windows, you can use this command:
flutter config --android-studio-dir="Path to your Android Studio"
Double check that inside Android Studio > SDK Manager > SDK Tools, Android SDK Command-line Tools are installed.

"Unable to locate Android SDK. " while running flutter doctor on windows 10

currently my andoid studio is in location
C:\Android\AndroidStudio
on console
C:\Users\aditya jain>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.0, on Microsoft Windows [Version 10.0.19043.985], locale en-IN)
[X] Android toolchain - develop for Android devices
X 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/windows#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[√] Chrome - develop for the web
[√] Android Studio
[√] Connected device (2 available)
! Doctor found issues in 1 category.
my sdk location is
C:\Users\aditya jain\AppData\Local\Android\Sdk
1>i have installed Android sdk platform tools and Android sdk tools (obsoloete)
2>I only have a Local, Loacallow and Roaming File but not a Platforms file
, as i have seen many youtube videos ..they said to add to path platform file but i can't see any in my appdata folder in users(it is hidden by default).
https://www.youtube.com/watch?v=7GuGlATHYX8&t=195s
3> ran flutter config command for my sdk and got
C:\Users\aditya jain>flutter config --android-sdk flutter config --android-sdk \C:\Users\aditya jain\AppData\Local\Android\Sdk
Setting "android-sdk" value to "flutter".
You may need to restart any open editors for them to read new settings.
C:\Users\aditya jain>
Android SDK cannot be found by flutter
in this que there is an answer
to run
flutter config --android-sdk /path/to/android/sdk
flutter config --android-studio-dir /path/to/android/studio
but i don't know what i should for my sdk location ..i have less reputation so i can't comment there to ask there so here i am posting ques
also tried
C:\Users\aditya jain>flutter config --android-sdk <sdk-"C:\Users\aditya jain\AppData\Local\Android\Sdk">
The syntax of the command is incorrect.
C:\Users\aditya jain>flutter config --android-sdk <sdk-C:\Users\aditya jain\AppData\Local\Android\Sdk>
The syntax of the command is incorrect.
as is suggested in same que ans but getting this given above
(i know my path contain spaces ..i tried to put my android in downloads so that there will be no spaces but there also i get errors as below
C:\Users\aditya jain>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.0, on Microsoft Windows [Version 10.0.19043.985], locale en-IN)
[X] Android toolchain - develop for Android devices
X 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/windows#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[√] Chrome - develop for the web
[!] Android Studio
X android-studio-dir = C:\Android\AndroidStudio
X Android Studio not found at C:\Android\AndroidStudio
[√] Connected device (2 available)
! Doctor found issues in 2 categories.
C:\Users\aditya jain>flutter config --android-studio-dir=C:\Users\aditya jain\Downloads\Android\AndroidStudio
Setting "android-studio-dir" value to "C:\Users\aditya".
You may need to restart any open editors for them to read new settings.
C:\Users\aditya jain>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.0, on Microsoft Windows [Version 10.0.19043.985], locale en-IN)
[X] Android toolchain - develop for Android devices
X 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/windows#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[√] Chrome - develop for the web
[!] Android Studio
X android-studio-dir = C:\Users\aditya
X Android Studio not found at C:\Users\aditya
[√] Connected device (2 available)
! Doctor found issues in 2 categories.
C:\Users\aditya jain>
i can't rename ' aditya jain' folder to 'adityajain'...it takes space....pls help mee.
please help and thanks community!!
If the path name has spaces, you can wrap the path with double quotes. This allows Windows to identify the path as a single String: "C:\Users\aditya jain\Downloads\Android\AndroidStudio"
If you have already configured SDK path for Flutter (flutter config --android-sdk ) and yet not working than...
Install the platform-tools resolves the problem.
Go to the SDK Manager (top-right in the toolbar), then open SDK Tools, then check-mark ✅ Android-SDK Platform-Tools and apply the changes (As shown below).
For me this solution worked.
Enjoy...
Check image

flutter run -bash: Desktop/flutter/bin/flutter: No such file or directory

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.1, on Mac OS X 10.14.6 18G103, locale pl-PL)
[✗] 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 11.2.1)
[!] Android Studio (not installed)
[!] Connected device
! No devices available
I created a my_app folder and typed:
cd my_app
flutter run
The "flutter run" command does not work. How to fix this?
Have you installed android sdk?
If not then installing Android Studio will will install all the required dependencies.
I faced this problem it easy to solve
Open Android Studio
And go to preference
Plugins
Download flutter & dart
You need Android SDK, if you plan on using Android Studio then SDK will be downloaded with the Android Studio
https://developer.android.com/studio is the link to download

Problem with Flutter Web. Chrome Beta is uninstalled but still showing up

I am facing a problem with the flutter web initialization. I followed the steps in https://flutter.dev/docs/get-started/web Everything went smooth
flutter channel beta
flutter upgrade
flutter config --enable-web
When I do Flutter Doctor I get
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, v1.17.0, on Microsoft Windows [Version 10.0.18363.778], locale en-IN)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
X Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions.
[X] Chrome - develop for the web (Cannot find chrome executable at C:\Program Files (x86)\Google\Chrome Beta\Application)
! C:\Program Files (x86)\Google\Chrome Beta\Application is not executable.
[√] Android Studio (version 3.6)
[√] VS Code (version 1.44.2)
[√] Connected device (1 available)
! Doctor found issues in 2 categories.
I don't have chrome beta on my PC anymore. I have normal chrome. How to change it. Somebody help me out.
Also, I got found this online as a solution but I don't know what it means.
export CHROME_EXECUTABLE=path/to/chrome
This is not the solution but an alternative method you can try. If you are in the beta channel of flutter you can just type flutter build web that will create a web build in your web folder. You can run it on any other server just like normal web application. If you want to do this to an existing project first run flutter create . then flutter build web.