我试图让React Native与Android V4.2.2 (Genymotion)
一起工作,但我无法在模拟器上测试应用程序.当我运行react-native run-android
时,我得到这个错误Could not run adb reverse: spawnSync
这是一份日志(log)
JS server already running.
Running ~/Library/Android/sdk/platform-tools/adb reverse tcp:8081 tcp:8081
Could not run adb reverse: spawnSync ~/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 '~/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
注意:在日志(log)中,它说SDK目录不存在,我仔细判断了一下我是否在该目录中安装了SDK.
我在执行adb devices
时找到了我的android模拟器
List of devices attached
192.168.56.101:5555 device
我在堆栈溢出帖子中try 了以下步骤,但仍然没有成功