16

I recently install react-native, initialize a project and run it

$ react-native init AwesomeProject
$ react-native run-android

Always get a error

adb server version (32) doesn't match this client (36); killing...

and my device shows me

Error

How to solve both error?

rkmax
  • 15,852
  • 22
  • 82
  • 170
  • Are you running the project on emulator or real device? Did you try disconnecting the device and running`adb kill-server` and `adb start-server` and run again ? – Tushar Khatiwada Jul 21 '16 at 18:48
  • I'm running on my real device – rkmax Jul 21 '16 at 18:48
  • Try disconnecting the device and running `adb kill-server` and `adb start-server`. – Tushar Khatiwada Jul 21 '16 at 18:50
  • I did a couple times before posted here – rkmax Jul 21 '16 at 18:50
  • I've solved the first problem (adb was installed twice, system package manager and android package manager) – rkmax Jul 21 '16 at 18:58
  • For the second one I found `A common issue is that the packager is not started automatically when you run react-native run-android. You can start it manually using react-native start.` this note on the documentation – rkmax Jul 21 '16 at 18:59
  • The second problem should be fixed by: Shaking your phone, Select `Dev Settings`, Select `Debug server host & port for device` and then `http:// ip-of-your-pc:8081`. Make sure your Packager Server is running and the device is connected to same network. – Tushar Khatiwada Jul 21 '16 at 19:02

3 Answers3

56

This is because the adb version on your system is different from the adb version on the android sdk platform-tools. you can check that to insure:

Open the terminal and check the adb version on the system:

$adb version

And from the Android SDK platform-tool directory:

$cd ~/Android/Sdk/platform-tools
$./adb version

simple solution: Copy adb from Android SDK directory to usr/bin directory.

$sudo cp ~/Android/Sdk/platform-tools/adb /usr/bin
vivid
  • 571
  • 3
  • 9
  • 4
    thanks, mine was in `/usr/local/bin` though. OS X El Capitan – vaskort Mar 28 '17 at 18:18
  • [OS X Sierra] For me, the problem seems to have come from a conflicting install of adb by expo. After comparing the version and pasting over the newer copy of adb from the android sdk (~/Android/Sdk/platform-tools/adb) install to the expo install (/usr/local/bin) it fixed the problem for me. The copy of adb in (/usr/local/bin) was actually an alias to the expo copy which I right clicked after running (open /usr/local/bin) and selected "show original". – gian848396 Sep 03 '17 at 20:12
1

Did you brew install android-sdk?

I was getting the following error when running react-native run-android:

adb server version (36) doesn't match this client (39); killing...
error: could not install *smartsocket* listener: Address already in use
ADB server didn't ACK
* failed to start daemon *
error: cannot connect to daemon
Could not run adb reverse: Command failed: /Users/beau/Library/Android/sdk/platform-tools/adb -s emulator-5554 reverse tcp:8081 tcp:8081

I found that I had adb installed at /usr/local/bin/adb:

$ ll /usr/local/bin/adb
lrwxr-xr-x  1 beau  admin  38 Mar 13 12:12 /usr/local/bin/adb@ -> ../Cellar/android-sdk/24.4.1_1/bin/adb

It was installed with brew install android-sdk and never used, so I uninstalled it:

brew uninstall android-sdk

…and the adb error was gone when I re-ran react-native run-android.

Beau Smith
  • 29,103
  • 12
  • 82
  • 88
-1

Thanks , this solution works for me. I have been struggling with this problem for few days, reinstall android studio, add custom android Sdk tools path under Genymotion ADB setting nothing works.Just wants to share with who have the same issues. I use Ubuntu 16.04. I did the copy adb to /usr/bin as suggested, since the adb version I have is 1.0.32.

/usr/local$ adb version Android Debug Bridge version 1.0.39 Revision 3db08f2c6889-android Installed as /usr/bin/adb Then I updated ADB setting under Genymotion to the default, use Genymotion Android tools. And start virtual device.

Under Expo XDE, start the project, then click device. Then I see the following message. Couldn't adb reverse: closed Opening on Android device Building JavaScript bundle: finished in 3669ms.

It works!!!

zizi
  • 53
  • 1
  • 6