React-Native, Android, Genymotion: ADB server didn't ACK

前端 未结 11 1987
梦毁少年i
梦毁少年i 2020-11-28 02:44

I am working with React-Native, Android, and Genymotion on Mac. When I run react-native run-android I get this lines at the end of the launch operation:

相关标签:
11条回答
  • 2020-11-28 03:37

    the adb version on your system is different from the adb version on the android sdk platform-tools . Below suggestion is work for me for Linux operating system

    1. check sys adb version run the below command

    adb version

    Android Debug Bridge version 1.0.39

    1. check sdk adb version

    cd /root/Android/Sdk/platform-tools

    ./adb version

    Android Debug Bridge version 1.0.32

    1. copy

    rm /usr/bin/adb

    [Note : the above command remove the existing adb then copy the adb from sdk/platform-tools directory ]

    sudo cp /root/Android/Sdk/platform-tools/adb /usr/bin/adb

    Then run the project using this command

    react-native run-android

    0 讨论(0)
  • 2020-11-28 03:39

    I am using genymotion, but Paul's solution alone did not fix the error (for Mac).

    I had to:

    Update Android SDK to the latest version (24.4.1) via the SDK manager

    Type android in the command line

    In the SDK manager find the latest SDK tools and install.

    Once installed the SDK path should update the new SDK location like below.

    Then update the $ANDROID_HOME to use the new SDK

    export ANDROID_HOME=/usr/local/Cellar/android-sdk/24.4.1_1

    export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

    Confirm it has been added by viewing your path with echo $PATH

    Then in genymotion do what @Paul says above and point genymotion ADB to use the same sdk

    0 讨论(0)
  • 2020-11-28 03:40

    I had a similar issue.

    First, I uninstalled the app. Then, I pointed GenyMotion to the android sdk provided from Android Studio Next, I ran "adb kill-server" into the terminal. Finally, I re-ran "react-native run-android" and got a build success.

    0 讨论(0)
  • 2020-11-28 03:42

    If want to keep your system clean, you can also use Genymotion without Android Studio:

    1. Find Genymotion's copy of adb. On macOS this is normally /Applications/Genymotion.app/Contents/MacOS/tools/.
    2. Add the Genymotion tools directory to your path - execute/add the line export PATH=/Applications/Genymotion.app/Contents/MacOS/tools/:$PATH to your ~/.bash_profile or ~/.bash_rc.
    3. Make sure that you can run adb from your terminal.

    (From https://docs.expo.io/versions/latest/workflow/genymotion)

    0 讨论(0)
  • 2020-11-28 03:44

    I had the same thing while I tried to run from expo UI. Did the same things, as described in answers, but app was not running. When once tried run exp android from command line (in the project folder), application ran successfully and next times runs from Expo UI was successfully.

    0 讨论(0)
提交回复
热议问题