'Expo with Android Studio Emulator error: "Error running adb: This computer is not authorized to debug the device"
I am trying to connect an Android Studio Emulator to my expo application, but I get this error message:
Couldn't start project on Android: Error running adb: This computer is not authorized to debug the device. Please follow the instructions here to enable USB debugging: https://developer.android.com/studio/run/device.html#developer-device-options. If you are using Genymotion go to Settings -> ADB, select "Use custom Android SDK tools", and point it at your Android SDK directory.
Does anyone know what to do with this?
Thanks!
Solution 1:[1]
What has worked for me just now:
- Go to tools.
- Select avd in Android studio.
- Select your emulator.
- Wipe data.
- Click "Start again".
Solution 2:[2]
tldr:
Look at the emulator "screen" and accept the prompt asking if you want to allow debugging.
I got that message you described in the question when I did the following:
- In Android Studio Virtual Device Manager (VDM), start the emulated device
- run
npm start(which runsexpo start)- expo Metro Bundler runs (command line and browser)
- in expo: select Android emulator
- in expo: see the same error that you posted
The provided link didn't seem to pertain to the emulator.
I didn't realize at first, but the solution was waiting on the screen of the emulated device. It was quietly showing a standard Android permission prompt, asking for permission to allow debugging the device. This prompt is described in the "note" in https://developer.android.com/studio/command-line/adb#Enabling,
Note: When you connect a device running Android 4.2.2 or higher, the system shows a dialog asking whether to accept an RSA key that allows debugging through this computer. This security mechanism protects user devices because it ensures that USB debugging and other adb commands cannot be executed unless you're able to unlock the device and acknowledge the dialog.
This of course I would expect for a phone, but didn't think of it for an emulator.
Once I granted that permission in the emulated phone, then expo proceeded to run on the emulator.
Solution 3:[3]
I discovered that "USB Debugging" had been turned off in the Developer Options of the emulator. Turning it on fixed the problem. No idea how it came to be turned off.
Solution 4:[4]
I had this problem today, I just disabled USB debugging and enabled it again. Worked.
Solution 5:[5]
- Go to android studio
- Open AVD manager
- Wipe data on your emulator (Clicking dropdown icon in actions column )
- Launch emulator
enjoy :)
Solution 6:[6]
I was using the emulator from Android Studio for my expo projects. It used to work properly. Then, one day the emulator stopped interacting with expo, always saying:
This computer is not authorized for developing on . https://expo.fyi/authorize-android-device
The advices given on that link did not help. Revoking the USB permissions did not help either. Even newly created Devices in AVD Manager did not let me connect.
However, finally this answer solved the problem for me
Choosing a device from AVD Manager without Google Play Store on it let me connect expo to the emulator, again.
Note: I could not get to the root cause of the problem, so I am still not sure why it stopped working all of a sudden. I upgraded to Expo SDK 39 at the same time that I switched from managed workflow to bare workflow. So, one of those circumstances may have caused the problem.
Solution 7:[7]
- First close your opened android emulator.
- Open android studio and go to AVD manager.
- Select virtual device which you have faced trouble, under actions select wipe data option.
- Give ok for the opened window.
- These steps worked for me.
Solution 8:[8]
I know the exact answer of this question The Problem is your AVD manager is not set to the path Than you have add to path first is ANDROID_SDK_ROOT and PLATFORM-TOOLS HERE I GIVE ALL THE LOCATION PLATFORM TOOLS - C:\Users\YOUR_USERNAME\AppData\Local\Android\Sdk\platform-tools ANDROID_DK_ROOT - C:\Users\YOUR_USERNAME\AppData\Local\Android\Sdk ADD in path (SEARCH ON START EVIRONMENT VARIABLES) and than restart your pc
Solution 9:[9]
Try running a lower version of the android emulator from android studio. I was getting the same error while trying to run the latest expo-react-native app on android emulator version 9.0 Pie. I got it working by running a lower version of the android emulator version 8.1 Oreo. You also have to tab allow/ok on the phone screen when asked for enable USB Debugging
during the app booting on the emulator.
Solution 10:[10]
I had the same issue and it almost took one day to figure that out. First try enabling the USB debugging mode, still if it shows the same error try the next step. Try to check ADB devices in cmd, if it doesn't work go and change the environmental variables of the android SDK manager.
And refer this link https://medium.com/@vsburnett/running-a-react-native-app-on-an-android-virtual-device-with-expo-in-windows-10-9e0976db5f50
Solution 11:[11]
For Windows:
Select 'Wipe Data' option in the AVD manager and restart again.
Or
Add SDK tools path eg: E:\Android\SDK and SDK platform-tools path eg: E:\Android\SDK\platform-tools in the windows system environmental variables. (In my case I have installed SDK inside the E directory)
Solution 12:[12]
Open the Android Virtual Device Manager(AVD Manager).
And in your current virtual device on the right side, there will be a dropdown icon, and click that icon.
In the dropdown list there will be a Wipe Data and click it.
And Run your Emulator
Solution 13:[13]
I was facing the same issue. I am using windows machine. Steps I did to resolve:
I have added the environment variable.
- To Add System Variable, search environment variable in Windows (or search google how to open environment variables, if you are on some other system or cmd). In the system variable add the Variable:
ANDROID_SDK_ROOTto your android studio path, like in my case it is:C:\Users\kushalseth\AppData\Local\Android\Sdk
- At the same place, i.e. System Variable, Click on Path and add this, it already doesn't exists. Please check this path in your system:
C:\Users\kushalseth\AppData\Local\Android\Sdk\platform-tools
- To Add System Variable, search environment variable in Windows (or search google how to open environment variables, if you are on some other system or cmd). In the system variable add the Variable:
To Validate, run the command: adb in command prompt.
(Also check, if you are logged-in to expo from cmd. This is an extra precautionary step.)
Solution 14:[14]
today I experience the same issue but I have fixed it very easily. Try the solution it might work for you too. Many developers have wsl or windows subsystem for Linux and it is using a VM and I found it blocks the android sim and causes the error "Error running adb". The solution I found was to open my PowerShell and type "wsl --shutdown". After rerunning the script for android emulation from expo it worked like a charm. Hope I helped.
Solution 15:[15]
Enable Virtualization on your machine
Enter your BIOS settings on boot of your machin and enable Virtualization Technology. The location may differ depending on your processor.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow




