【问题标题】:Android React Native build failAndroid React Native 构建失败
【发布时间】:2018-03-08 13:30:49
【问题描述】:

我创建了简单的 React Native 项目。

第 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

谢谢!!

【问题讨论】:

    标签: android react-native sdk


    【解决方案1】:

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

    【讨论】:

    • 在哪里可以查看。
    • 你的 sdk 路径是`'C:\Users\Smith\AwesomeProject\android\C:UsersSmithApp DataLocalAndroidsdk'`,它不是一个有效的值
    猜你喜欢
    • 2019-03-21
    • 1970-01-01
    • 2020-08-12
    • 2016-07-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-07
    • 1970-01-01
    相关资源
    最近更新 更多