我是 React Native 语言的新手,我在 Android 中运行该应用程序时遇到了困难。
错误是:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.>
java.io.IOException: Could not delete path'C:\Users\Documents\projectFolder\android\app\build\generated\source\r\debug\android\support\graphics\drawable'.
在我的 package.json 中
"name": "sampleProject",
"version": "0.1.6",
"private": true,
"scripts": {
"start": "rm -rf __globals__ && cp -fR ../../globals __globals__ && npm run lint && node node_modules/react-native/local-cli/cli.js start",
"ios": "rm -rf __globals__ && cp -fR ../../globals __globals__ && npm run lint && react-native run-ios",
"android": "rm -rf __globals__ && cp -fR ../../globals __globals__ && npm run lint && react-native run-android",
"log-ios": "react-native log-ios",
"log-android": "react-native log-android",
"test": "jest",
"reset": "rm -rf __globals__ && cp -fR ../../globals __globals__ && npm run
lint && node node_modules/react-native/local-cli/cli.js start --reset-
cache",
"lint": "eslint --fix --max-warnings 1 .",
"precommit": "npm run lint"
},
"dependencies": {
"async": "~2.4.1",
"bluebird": "~3.5.0",
"color-term-console": "~1.0.4",
"crypto-js": "~3.1.9-1",
"file-extension": "~3.1.2",
etc ...
我该怎么办?
最佳答案
试试这个:
使用命令 cd android
转到 android 文件夹,然后运行 ./gradlew clean
现在通过 cd ..
回到你的项目文件夹
然后react-native run-android
关于reactjs - React Native 中的 react-native run-android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45415766/