1

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

"Unable to locate adb" error from AVD Manager

Umair M
  • 10,298
  • 6
  • 42
  • 74
Sruthi G
  • 11
  • 1
  • 2
  • I think you should check the answers from this similar question.[enter link description here](https://stackoverflow.com/questions/39036796/unable-to-locate-adb-using-android-studio) – Milan Poudel Jul 06 '20 at 03:59
  • @MilanPoudel Unfortunately, I have already tried everything that was mentioned in that conversation chain, but nothing worked for me. – Sruthi G Jul 06 '20 at 16:17

2 Answers2

4

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.

Ruben Helsloot
  • 12,582
  • 6
  • 26
  • 49
Ravikiran
  • 512
  • 3
  • 14
0

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.

James Mwase
  • 828
  • 1
  • 16
  • 29