【发布时间】:2021-02-22 08:24:42
【问题描述】:
我是 react native 的新手,所以请帮助我开始。我只是使用这个命令创建了我的第一个 react-native 项目
npx react-native init AwesomeProject
我已经安装了android studio并在环境中添加了sdk的路径。在我的 android 中也使用了开发者选项。当我运行该命令时
npx react-native run-android
它给了我很多这样的错误
* What went wrong:
Could not determine the dependencies of task ':app:installDebug'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at 'E:\react_native\AwesomeProject\android\local.properties'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 7s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
【问题讨论】:
标签: react-native