expo / expo-cli

Tools for creating, running, and deploying universal Expo and React Native apps
https://docs.expo.io/workflow/expo-cli/
2.61k stars 478 forks source link

Couldn't start project on Android: Error running adb: #694

Closed pioNavarro closed 5 years ago

pioNavarro commented 5 years ago

I'm having a problem running the expo to my android studio emulator. Its so wierd because it works on my android device but not on my emulator.

Here's the error I'm getting. image

My Expo version is 2.19.1 My Android Studio version: image

cruzach commented 5 years ago

Hi @pioNavarro - you need to have the Android emulator opened, then you can open the project on it. Let me know if that works!

akayjangra commented 5 years ago

i also have the same problem plase help jhfjhfjfgjgjhgjhgjhgjhjh

brentvatne commented 5 years ago

https://docs.expo.io/versions/v33.0.0/workflow/android-studio-emulator/

akayjangra commented 5 years ago

everything as described. I run my project at night and the next morning I get this error but m very sure that nothing is changed by me. m working on windows 10 Android Debug Bridge version 1.0.41 Version 29.0.0-5611747 the problem is only on the expo... react-native working well.

https://docs.expo.io/versions/v33.0.0/workflow/android-studio-emulator/

DaveBben commented 5 years ago

Same issue. I just get the following error:

Couldn't start project on Android: Error running adb:

DeathYouki commented 5 years ago

I'm having the same error, It showed up after a small update of Android studio. (Although I haven't opened the emulator in about a week). image

Expo is working fine on my phone, so I guess I'll be using it for now...

AnsarSamad commented 5 years ago

Same issue. I just get the following error: using expo-cli version 2.19.4

Couldn't start project on Android: Error running adb:

EdissonCruzM commented 5 years ago

I have genymotion and i have the Android emulator opened, an i have the same error

TimLampen commented 5 years ago

I have the same error using a pixel 2 emulator through android studio and Q / Pie / Oreo builds

cruzach commented 5 years ago

In order to help, we need to be able to reproduce the issue on our end so if someone could share steps, please do!

TimLampen commented 5 years ago

@cruzach

pioNavarro commented 5 years ago

it's so weird here's the error I'm having if I use the browser. image

My temporary solution is to log in my expo account. image

cruzach commented 5 years ago

@TimLampen, following those steps doesn't result in the error for me (both with Android Studio versions 3.3 and 3.4) Pixel 2 Q

If you are posting to this issue, try to provide more information than is already present. For instance, sharing your environment is a good idea as we may notice a pattern to what results in this error!

schellack commented 5 years ago

I have this issue reported here as well. When I tried to create reproducible steps to post, I created a branch new Pixel 2 image. This new image does not have the problem. It's only my old Pixel 2 AVD that does.

One difference I can see between them is that the expo-cli doesn't show this message for the emulator that doesn't work properly:

Successfully ran adb reverse. Localhost URLs should work on the connected Android device.

After some digging, all I could figure was that my older emulator could not longer be connected to via adb. So for others who have this issue: perhaps try creating a new emulator?

dragosdehelean commented 5 years ago

I've just created a new Pixel 2 image and the problem remains the same: image

apiep commented 5 years ago

I also have the same problem, be it emulator or real device (samsung A7 and Xiaomi Redmi 5).

λ adb --version
Android Debug Bridge version 1.0.41
Version 29.0.0-5611747
Installed as C:\Users\Me\AppData\Local\Android\Sdk\platform-tools\adb.exe

λ expo --version
2.19.4

Andy4ward commented 5 years ago

Was pointed in the direction of this thread overnight.

Went to start the project this morning and was informed that expo-cli was now at version 2.19.5 so did the update.

Went to open Android Studio to see if the new cli version was going to fix the adb problem and was informed that there was an update to the sdk platform-tools for version 29.0.1. So did the update.

Ran expo start with the updated cli and platform tools and it came up first time without a problem.

Not sure which update was responsible or if it was a combined effort but thanks for getting this sorted.

pioNavarro commented 5 years ago

Thank you for the information @Andy4ward i got my expo now working. I thought the fix was reinstalling my android studio.

cake221 commented 5 years ago

@pioNavarro reinstalling my android studio can fix this issue?

pioNavarro commented 5 years ago

@pioNavarro reinstalling my android studio can fix this issue?

try to update first your expo. if not fixed then try to reinstall your android studio.

tiagocpeixoto commented 5 years ago

I was facing the exact same problem.

I used scoop to install android-sdk with Powershell (Windows 10). So I uninstalled it (android-sdk) and reinstalled it with CMD (and not Powershell). So the problem with adb was solved and I could start Android emulator.

Hope it helps.

meenal456 commented 5 years ago

I have updated expo version in package.json file. But after uninstalling and reinstalling Android Studio ,I was facing same error. Please help me to solve this issue.

muradmm83 commented 5 years ago

I had the same issue. I'm using Windows 10. It appears that this issue only happens if I use git bash. When using PowerShell everything is fine. Also, using git bash if you type expo start --android your app will app in your emulator. Hope that helps.

fzabin commented 4 years ago

I had a similar issue after update the expo-sdk version of a project and I tried another emulator image and it ran just fine. Then I reset the emulator image with problem and tried again and it worked too.

The message I received was:

Couldn't start project on Android: Error running adb: Error running app. Error: Activity not started, unable to resolve Intent { act=android.intent.action.VIEW dat=exp://192.168.0.8:19000 flg=0x10000000 }

Hope it helps.

EfeAgare commented 4 years ago

Install the expo app on your android emulator, then restart your server

jithustvr commented 4 years ago

Open your Expo by typeing expo start Then open your android studio goto tools -> AVD Manger Then launch any installed emulator Then open expo and click on Run on Android device/emulator will be fine

aman90attari commented 4 years ago

I had same problem solve after disconnecting my phone from PC or USB debugging disable will also work

donni106 commented 4 years ago

expo start --android gives me:

Bildschirmfoto 2020-05-14 um 13 28 41

I got this without any further message. It does not matter if I try an emulator or with a real device.

gouravrc commented 4 years ago

This worked for me 👍

Open Android Studio > SDK Manager > SDK Tools

You can see the items which need to be updated. Check Status column. if you see Update available, please update the following.

Hope it helps.

praneethpj commented 4 years ago

run with sudo

sudo expo start --android

azizulhaq800804 commented 4 years ago

had the same issue. First time it failed. Then keeping the emulator open and then "npm start" resolved it.

Palash1999 commented 4 years ago

I had a similar issue after update the expo-sdk version of a project and I tried another emulator image and it ran just fine. Then I reset the emulator image with problem and tried again and it worked too.

The message I received was:

Couldn't start project on Android: Error running adb: Error running app. Error: Activity not started, unable to resolve Intent { act=android.intent.action.VIEW dat=exp://192.168.0.8:19000 flg=0x10000000 }

Hope it helps.

I cleared the data of my emulator and it worked!

jpg-130 commented 4 years ago
  1. Keep usb debugging ON in developer mode.
  2. In notification bar (android device) keep in transfer files mode(to enable sdk/adb whatever installation).
  3. Then run expo start --android.

I was having the same issue but solved it this way. (Using the latest version of everything)

saini-facundo commented 4 years ago

maybe you have your cell phone connected to your pc? That happened to me. unplug the cell phone and it worked fine

FranH20 commented 4 years ago

Fix the problem by entering my Google account in the emulator so that I can download the application image

arfizurrahman commented 4 years ago

I encountered the same issue. In my case, I've created the virtual device with the API level 29, but I had the SDK manager with API level 30 installed. So, I installed the SDK manager 29. It solved my issue.

eduhdm commented 4 years ago

What solved this issue for me is killing the current connection in adb: executed: adb devices got the id of the connection and run: adb disconnect <connection-name> Then, I runned the project in android again.

GabrielCozma commented 4 years ago

Hello! I had the same issue, trying with Andorid Emulator device and Genymoion Emulator. Both with the same problem. I solved it by uninstalling Android Studion, after that I've creted a new emulator with the latests API version and after that my Expo app run's fine. I hope this will help you, it took's me 3 hours of trying.

addemark commented 4 years ago

Open your Expo by typeing expo start Then open your android studio goto tools -> AVD Manger Then launch any installed emulator Then open expo and click on Run on Android device/emulator will be fine

This worked for me

awaldron commented 3 years ago

run with sudo

sudo expo start --android

This worked for me. Also had to have my AVD already open. Thanks!

GabrielCozma commented 3 years ago

I'm on windows, but thank you!

vin., 20 nov. 2020, 16:47 Alan Waldron notifications@github.com a scris:

run with sudo

sudo expo start --android

This worked for me. Also had to have my AVD already open. Thanks!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/expo/expo-cli/issues/694#issuecomment-731212522, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOS3E5PQBH3HJ6JVULNVZJLSQZ6QRANCNFSM4HWUVR3A .

douglascavanaugh commented 3 years ago

I originally posted the same issue back in May on StackOverflow

https://stackoverflow.com/questions/61858084/android-emulator-adb-error-device-still-connecting.

My issue was that I was trying to run two different Android emulators at the same time, and when I clicked the "Run on Android device/emulator" from the Metro Bundler, the emulator crashed and when I booted the Android emulator back up, then clicked on the "Run on Android device/emulator" again, I got the error "Couldn't start project on Android: Error running adb: more than one device/emulator." Come to find out, the adp device was stuck trying to connect to "emulator-5562 connecting" and I couldn't kill it.

I found the solution in this StackOverflow post:

https://stackoverflow.com/questions/54953134/prevent-android-emulator-from-starting.

I followed his directions exactly and just now (after 6 months), started using my Android emulator again.

kyawthura-gg commented 3 years ago

Restarting the emulator worked for me 🔥

Screenshot 2020-12-18 at 12 06 14 PM

Stukz commented 3 years ago

My app isn't working properly on my real device with SDK 22 so decided to use emulator and try to debug but I'm having this issue. (Pixel w/ SDK 30 doesn't have problems) image

Also Pixel 4 with SDK 22 image

On Pixel 4 SDK 23 works image

jaberbatoii commented 3 years ago

Hi, I can not install the Android Studio SDK, and every time I delete it and install it again, this part is empty and I did not bring any Android platform. Gmail :jaber105033@gmail.com

aleks-rope commented 3 years ago

I got it to work on Ubuntu 20.04.1 LTS. Using android studio 4.1.1 by running expo start selecting android from terminal and running the emulator from Android studio. It took a while to download the expo updates on the emulator but it worked. If you need help setting up android studio properly see this guide: https://docs.expo.io/workflow/android-studio-emulator/

HeIp commented 3 years ago

This issue is still going on, an update should address this so developers don't' have to manually start up the android emulator from Android Studio. And should work as fluid as it does with react native. This Issue should still be marked as OPEN.

Damian-16 commented 3 years ago

A mi me funciono iniciando otro emulador en el AvdManager, prueben con eso si se les ha congelado el emulador y no los deja hacer pruebas

SajjadTasawar commented 3 years ago

update expo-cli and create a new virtual device in andriod studio and select the one with playstore .This solved my problem.

richjeffery commented 3 years ago

My solution to this, after trying a bunch and still getting device offline on a Pixel C emulator running Android 10, was :

1) to turn on Developer Options in the emulator by tapping on the Build number in Settings>About emulated device seven times until it says 'you are now a developer!' 2) Going into System>Advanced>Developer Options 3) Turning on USB debugging.

And now Expo can see my device.