2

Fresh init of a RN project with a fresh copy of React Native Full Pack in VSCode. I'm unable to get this new project to debug, but am able to get other projects to debug using the same methods. I've tried recreating the project and still no dice. I can use react-native run-android in a command prompt to get it to debug, but not VSCode. I keep getting this error:

events.js:167
      throw er; // Unhandled 'error' event
      ^

Error: EPERM: operation not permitted, lstat 'c:\Users\user\Documents\repos\app\android\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\android\support\asynclayoutinflater'
Emitted 'error' event at:
    at NodeWatcher.<anonymous> (c:\Users\user\Documents\repos\app\node_modules\metro\node_modules\sane\src\node_watcher.js:291:16)
    at c:\Users\user\Documents\repos\app\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)

I've also tried running the packager first, but it still default to a --no-packager run.

Nerdragen
  • 2,976
  • 2
  • 11
  • 22

3 Answers3

1

Deleting and reinstall NPM packages seems to work some of the time. But a better way to fix this problem is to run gradlew.bat clean from inside the android folder of the RN directory, then rerun the packager and restart the app.

Nerdragen
  • 2,976
  • 2
  • 11
  • 22
0

You can also clean your build cache and gradle cache.

For more detail about how to do it, check this article: How to clear gradle cache

Alberto L. Bonfiglio
  • 1,767
  • 23
  • 38
nima
  • 7,796
  • 12
  • 36
  • 53
0

install NodeWatcher. use this command in windows : npm install node-watch

also try this.

Amir133
  • 2,372
  • 2
  • 18
  • 34