运行npx react-native run-android命令

时间:2020-07-14 19:00:23

标签: android react-native

Android

这是我尝试运行我的本机项目时得到的错误

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
BUILD FAILED in 1m 58s

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

2 个答案:

答案 0 :(得分:1)

Make sure you have the Android development environment set up

我认为您需要在项目中包含sdk路径的local.properties文件。

enter image description here

答案 1 :(得分:0)

我通过擦除仿真器的数据来解决此问题。
转到android studio->然后打开AVD Manager->单击模拟器的三角形图标。 ->然后单击清除数据。
之后,运行react-native run-android。