First, I can build and run fine on both emulator and device (Pixel XL) just fine in Android Studio. I have come across several cases of this in other posts on git and stack overflow. None of the solutions have worked.
When I run expo start it opens the browser developer console for expo. When I click on “Run on Device/Emulator” . I get an error.
Starting Metro Bundler on port 19001.
WARNING 09:01 Couldn’t adb reverse: adb: error: unknown host service ERROR 09:01 Couldn’t start project on Android: Error running adb: unknown host service
In command line “adb devices” lists my devices fine. When I run “adb usb” I get an error “error: unknown host service” . I assume this is the problem but I am having a hard time finding a solution.
I have tried completely uninstalling and reinstalling android studio and platform tools.
On a side note: The slack registration is broke. When I fill out email and click the Im not a robot button and click Get Invite I get an error in the button “not_allowed_token_type”. In dev tools it looks like its trying and failing to call a socket.io connection in both Chrome and Firefox.
(I believe the adb command that expo-cli is using is installed along with expo-cli. e.g. I have my node installation under /usr/local/node and adb is here:
If I run that adb devices with a phone connected I get something like this:
$ /usr/local/node/lib/node_modules/expo-cli/node_modules/@expo/xdl/binaries/linux/adb/adb devices
List of devices attached
999a9a999999999999 device
This is just a guess, but I think if the device ID contains colons it could potentially cause this error. (e.g. see this.) As to how you deal with that if that is the case, I don’t currently know but maybe it gives you a place to start at least.
The adb devices command just gives me my currently connected device.
List of devices attached
HT68K0209999 device
When I look at “where adb” in commandline (mac) I see it located in the following directories.
/usr/local/bin/adb
/Users/myuser/Library/Android/sdk/platform-tools/adb
Do you think its possible that expo is using the wrong version of the command? If so would you know how to force it to use the right version?
Looks like it checks (using hasbin) if the binary is in the PATH. So in theory you should be able to remove /usr/local/bin and /Users/myuser/Library/Android/sdk/platform-tools from the PATH or else put the PATH to Expo’s version first in the PATH.
If that doesn’t help, maybe try running the adb commands manually to see which command fails: