React Native adb reverse ENOENT

j'essaie de le faire Réagir Indigènes à travailler avec <!-Mais je ne peux pas tester l'application sur L'émulateur. Quand j'ai couru react-native run-android, j'ai cette erreur Could not run adb reverse: spawnSync

Voici un log

JS server already running.
Running /User/Pan/Library/Android/sdk/platform-tools/adb reverse tcp:8081 tcp:8081
Could not run adb reverse: spawnSync /User/Pan/Library/Android/sdk/platform-tools/adb ENOENT
Building and installing the app on the device (cd android && ./gradlew installDebug...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> The SDK directory '/User/Pan/Library/Android/sdk' does not exist.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3.785 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

REMARQUE: Dans le journal qu'il saids SDK répertoire n'existe pas, j'ai vérifier que j'ai le SDK installé dans ce répertoire.

j'ai trouvé mon émulateur android lors de l'exécution de adb devices

List of devices attached
192.168.56.101:5555 device

j'ai essayé les étapes suivantes À partir du débordement de la pile post, mais toujours pas de chance https://stackoverflow.com/a/38536290/4540216

14
demandé sur Community 2016-08-08 21:17:08

2 réponses

j'ai eu le même problème. J'ai mis à jour ma variable env D'ANDROID_HOME à nouveau ça a fonctionné pour moi.

Suivre ce Réagissent-native android-documentation d'installation

ex:

export ANDROID_HOME=~/Library/Android/sdk
26
répondu SureshCS50 2016-08-09 09:31:48

j'ai aussi eu le même problème. Et j'ai mis à jour ma variable env D'ANDROID_HOME à nouveau dans le même cmd et ça a bien fonctionné.

> export ANDROID_HOME=~/Android/Sdk 
> export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

bonne chance

6
répondu Dinithe Pieris 2016-12-12 14:02:19