skip to Main Content

Unable to run "adb", check your Android SDK installation and ANDROID SDK_ROOT environment variable: C:UsersuserAppDataLocalAndroidSdkplatform-toolsadb.exe

i have set up everything related to flutter, but no adb devices& flutter devices & my physical phone also not showing in Android studio.

i have also set path and environment variable as said in the error.
If you have any way of solving this problem, please let me know.

2

Answers


  1. There maybe different problems causing for this.

    1. I recommend checking SDK installation. Look does your SDK installed in the correct directory. The default one is ‘C:UsersuserAppDataLocalAndroidSdk’.

    2. You can restart adb server. Run this code in your terminal:

       adb kill-server
       adb start-server
      
    3. If you are using physical phone, check USB connection is set to "Transfer Files" or "File Transfer".

    4. And also enable USB debugging. Go to developer options and make sure USB debugging is enabled. If you don’t see the "Developer options" in your device settings, go to "About phone" and tap on the "Build number" multiple times (usually 7 times) until it unlocks the developer options.

    5. Update your ADB. You can update ADB running this on your terminal:

       sdkmanager --update
      
    6. Maybe deleting Platform tools, and reinstalling them will work.

    7. You can add ADB path manually rather than relying on the ANDROID_SDK_ROOT environment variable, here is how you can do this.:

      • Open the Environment Variables settings as mentioned earlier.
      • Locate the Path variable in the "System variables" section and select it.
      • Click on "Edit" to modify the variable.
      • Add a new entry with the path to the directory containing the ADB
        executable (e.g., C:UsersuserAppDataLocalAndroidSdkplatform-tools).
      • Click "OK" to save the changes.
      • Restart your command prompt or terminal and try running adb devices or flutter devices again.
    8. Try a Different Version of ADB or reinstall Android Studio.

    9. And consider updating flutter itself. You can update by running this command on your terminal:

      flutter upgrade
      
    10. Last but not least run this command also :

      flutter doctor
      This checks for any additional setup requirements or conflicts. The output will provide insights into any missing dependencies or misconfigurations that need to be addressed.

    Login or Signup to reply.
  2. your ANDROID_SDK_ROOT variable should be :

    environment variable: C:UsersuserAppDataLocalAndroidSdk

    and not

    environment variable: C:UsersuserAppDataLocalAndroidSdkplatform-toolsadb.exe

    1. In Windows Bar type in Search: "Environment properties"
      This should open System Properties

    2. Select "Enrvironment Variables"

    3. Select "Path" Variable and click "Edit"

    4. Seperate the Path’s witch semicolon ";"
      e.g. C:flutterbin; C:UsersuserAppDataLocalAndroidSdk; etc.

    5. Restart your computer or Logout from Account and login.

    Try to start adb again

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search