"Unable to locate adb" using Android Studio on Windows 10 to develop Flutter apps - android-studio

Android Studio upgraded to version 4.0.1, and now I get a "Unable to locate adb" message when trying to launch an Android emulator image from the AVD manager, in order to run/debug a Flutter app. I have tried all the obvious things, e.g. checked to see that there is an adb.exe image at .../AppDate/Local/Android/Sdk/platform-tools. I have even tried de-installing completely and did a clean install of everything from scratch. I have plenty of disk space, anti-virus has not quarantined it. Interesting, if I start a native Android app (e.g. "basic activity"), then the message goes away and the image starts OK

Android Studio - launch emulator AVD - "unable to locate adb"
Visit the above link to get solution in detailed way with pictures.
I had the same issue as you were facing, I have Researched the Whole Internet but found nothing useful. So, I somehow figured out the problem and fixed it, The problem is at
app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
Whenever we create a new project due to some reason the Module SDK is not set up automatically. Thus the ADB manager was throwing an error 'Unable to locate AVD', which is not that fatal as the error/warning is not stopping us from launching /starting the emulator, but it is so annoying to see that pop-up box. So here is my simple and quick fix.
Solution:
Click on the project folder, tap the dropdown icon just beside it.
Now Navigate to the path below.
android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
Now Click on the file GeneratedPluginRegistrant.java to open it.
Once it is open, At the Top you will notice a bar that says 'Module SDK is not defined',
Now right against it, you will also see a hyper-text named 'Setup SDK', Just Click on it.
That will open a Pop-up Box with the title 'Select project SDK'.
Now select the Android Platform API and then click OK. After that being done Restart your IDE.
Your Problem will be Solved. And you will also notice that Emulator Opens up way faster than before.
NOTE:
The Above Steps has to be performed with every new flutter project.
I have already answered to your question before to Read more and understand in detail with pictures just visit the link
Android Studio - launch emulator AVD - "unable to locate adb"

Related

Unable to locate ADB Android studio, flutter

I know there is already post about this, but none seems to work for me. Android studio unable to locate ADB. I checked my adb.exe exists in the path folder. I have deleted my McAfee anti virus as well following the advice from before, but not working.
Found the solution. The virtual device api was Android 10+ (30), and I just added another virtual device (Android 10, 30). I don't see the error any longer 😊👍👍
I had the same issue as you were facing, I have Researched the Whole Internet but found nothing useful. So, I somehow figured out the problem and fixed it, The problem is at
app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
Whenever we create a new project due to some reason the Module SDK is not set up automatically. Thus the ADB manager was throwing an error 'Unable to locate AVD', which is not that fatal as the error/warning is not stopping us from launching /starting the emulator, but it is so annoying to see that pop-up box. So here is my simple and quick fix.
Solution:
Click on the project folder, tap the dropdown icon just beside it.
Now Navigate to the path below.
android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
Now Click on the file GeneratedPluginRegistrant.java to open it.
Once it is open, At the Top you will notice a bar that says 'Module SDK is not defined',
Now right against it, you will also see a hyper-text named 'Setup SDK', Just Click on it.
That will open a Pop-up Box with the title 'Select project SDK'.
Now select the Android Platform API and then click OK. After that being done Restart your IDE.
Your Problem will be Solved. And you will also notice that Emulator Opens up way faster than before.
NOTE:
The Above Steps has to be performed with every new flutter project.
I have already answered the problem here before.
Follow this link to see the pictures and step by step process.
Android Studio - launch emulator AVD - "unable to locate adb"

AVD Manager Error: "Unable to locate adb"

I tried to install flutter (including android studio and emulator) on Windows OS (also tried Linux dist. (Ubuntu)). I keep getting the same error when I try running the emulator: "Unable to locate adb". However, I checked and the adb file is located in platform-tools and the path is referenced correctly (to my knowledge). Also, even though the error pops up, the emulator still loads. I've even tried running the test code (despite the error), it gets stuck on the following line: "Running Gradle task 'assembleDebug'...". I have checked environment variable path/made sure paths are set correctly. I have tried reinstalling the software and the platform-tools folder, as well as any other suggestion I've seen online. I can provide more info if needed. Any help would be greatly appreciated!
Software Version Info:
Windows 10 Home,
Ubuntu 20.04,
Flutter 1.17.4,
Dart 2.8.4,
Android Studio 4.0
Android Studio - launch emulator AVD - "unable to locate adb"
I have answered to your question already, kindly visit the above link to read more.
Solution:
Click on the project folder, tap the dropdown icon just beside it.
Now Navigate to the path below.
android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
Now Click on the file GeneratedPluginRegistrant.java to open it.
Once it is open, At the Top you will notice a bar that says 'Module SDK is not defined',
Now right against it, you will also see a hyper-text named 'Setup SDK', Just Click on it.
That will open a Pop-up Box with the title 'Select project SDK'.
Now select the Android Platform API and then click OK. After that being done Restart your IDE.
Your Problem will be Solved. And you will also notice that Emulator Opens up way faster than before.
NOTE:
The Above Steps has to be performed with every new flutter project.
I just recently experienced this issue myself. I'm on Ubuntu 18.04.5 LTS.
This was happening because there wasn't enough space in my pc.
The solution was to make space in my home directory by deleting old stuff.

Annoying "Create Desktop Entry" popup in Android Studio on Ubuntu 16.04

Recenty I installed Android Studio on my laptop running Ubuntu 16.04.
When I created a new project and used Android Studio, this annoying popup kept showing: (Because my low reputation, I cannot post images, please click the link below)
https://i.stack.imgur.com/zNMbk.png
I tried to check the checkbox but it still display everytime I click on anywhere in Android Studio.
Help me, thanks in advance.
Try to use this for creating a desktop entry: desktop-file-install THE_DESKTOP_FILENAME_HERE.desktop
It might be the solution (if error it's because it localized the fileB, if ok it will copy to the correct localization /usr/share/applications) Restart then
After trying many times, I decided to reinstall Android Studio and the error disappeared! I don't know the reason clearly but maybe using Create Desktop Entry in Android Studio and creating a .desktop file manually (after installing Android Studio, I wanted to add Android Studio icon to launcher) caused conflicts.
goto settings in android studio
keymap-> main menu-> tools-> create desk entry
right-click on "create desktop entry"
you will get an option to turn off it.

Android Studio Clicking on "Project Structure " not working

I have met a strange question about Android Studio and I have tried to find a solution on the Internet but it failed.
Here is my question:
I open the Android Studio and the project can be installed to my device correctly. However, when I tried to open the Project Structure, it failed without any response. I just clicked on the button below but the Project Structure dialog didn't show up:
I have SDK installed below:
Please help me how to open the Project Structure dialog.
I have found a method to avoid my problem. My way is that uninstalling my sdk which version is Android 4.4. After doing that my project structure shows up. try deleting your current sdk for an attempt.

Android Studio won't run application from studio ide?

I've got an application I've been working on and am having an issue with android studio. When I click "build->run" and then select my device, the application never runs on my phone (and the log in android-studio that automatically comes up does not have anything, whereas in the past when I have used this feature it usually says something like, "waiting for phone..." and then the application pops up and automatically opens on the phone and you get some other pertinent information). I have the phone already in developer mode with the install from unknown sources set to on. When I manually move the application from its gradle build location to the phone and then install it manually in file explorer, all is well and the application performs as expected. As I need to debug, however, this is not a very viable solution. Anybody have any advice as to how to get it to run from the IDE? I have tried rebuilding and invalidating the cache/restarting android studio, to no avail.
When I click the run tab at the bottom I have an empty window. When I click the debug tab, I see:
Waiting for device.
Target device: samsung-samsung_sm_g920a-randomIntegerId
Uploading file
local path: /home/eric/Documents/class/OOSE/final_project/2015-group-17/project_code/android/Place2B/app/build/outputs/apk/app-debug.apk
remote path: /data/local/tmp/oose2017.myApp
Note: I am building the application on a LUbuntu 15.04 VM on a windows 8 host, and am using the latest version of android studio.
EDIT: gradle console indicates a successful build as well (obviously since moving the .apk manually to the device works properly).
Open 'Run->Edit Configurations...', and look for your app module in the column on the left-hand side.
Select it, then go to the 'General' tab.
Under the 'Activity' section, there are a couple of radio buttons. Make sure that 'Launch default activity' is selected.

Resources