Android React Native构建失败

时间:2017-09-27 07:03:28

标签: android react-native sdk

我创建了简单的React Native Project。

第1步。 C:> react-native init AwesomeProject

第2步。 C:> cd AwesomeProject

第3步。 C:> react-native run-android

之后我遇到了以下错误。

C:\Users\Smith\AwesomeProject>react-native run-android
Scanning 575 folders for symlinks in C:\Users\Smith\AwesomeProject\node_modul
es (13ms)
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat install
Debug)...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> The SDK directory 'C:\Users\Smith\AwesomeProject\android\C:UsersSmithApp
DataLocalAndroidsdk' 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: 4.774 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

谢谢!

1 个答案:

答案 0 :(得分:0)

您环境中的Android sdk路径不正确。