在VSCode中使用React Native Full Pack的新副本完成RN项目的初始初始化。我无法让这个新项目进行调试,但能够使用相同的方法让其他项目进行调试。我已经尝试重新创建项目,但仍然没有骰子。我可以在命令提示符中使用react-native run-android
来调试它,但不能使用VSCode。我一直收到这个错误:
events.js:167
throw er; // Unhandled 'error' event
^
Error: EPERM: operation not permitted, lstat 'c:\Users\nadjatee\Documents\repos\ShinSplints\android\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\android\support\asynclayoutinflater'
Emitted 'error' event at:
at NodeWatcher.<anonymous> (c:\Users\nadjatee\Documents\repos\ShinSplints\node_modules\metro\node_modules\sane\src\node_watcher.js:291:16)
at c:\Users\nadjatee\Documents\repos\ShinSplints\node_modules\graceful-fs\polyfills.js:282:31
at FSReqWrap.oncomplete (fs.js:158:21)
[Error] Error: Error while executing command 'react-native.cmd run-android --no-packager': Error while executing command 'react-native.cmd run-android --no-packager' (error code 101)
我也尝试先运行打包器,但它仍然默认为--no-packager
运行。
删除和重新安装NPM包似乎在某些时候有效。但解决此问题的更好方法是从RN目录的android文件夹中运行gradlew.bat clean
,然后重新运行打包程序并重新启动应用程序。
您还可以清理现金和现金。
有关如何操作的更多详细信息,请查看以下文章:How to clear gradle cache?