我是react-native的新手,当尝试使用npm react-native run-android运行android时,出现此错误:
FAILURE: Build failed with an exception.
* What went wrong: Execution failed for task ':app:processDebugResources'.
> Could not read path 'D:\*PROJECTPATH*\android\app\build\generated\not_namespaced_r_class_sources\debug\r\androidx\arch'.
BUILD FAILED in 28s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
BUILD FAILED in 28s
at checkExecSyncError (child_process.js:629:11)
at execFileSync (child_process.js:647:13)
at runOnAllDevices (D:\*PROJECTPATH*\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
但是,当尝试从Android Studio运行它时,它运行良好。谁能告诉我为什么?谢谢。
我的环境:
操作系统:Windows 10
NPM:6.14.4
节点:v10.21.0