04
17
Error: ENOENT: no such file or directory, open '프로젝트경로\http:\localhost:8081\index.bundle?platform=android&dev=true&minify=false&app=com.프로젝트명&modulesOnly=false&runModule=true'
    at Object.openSync (node:fs:585:3)
    at Object.readFileSync (node:fs:453:35)
    at getCodeFrame (프로젝트경로\node_modules\metro\src\Server.js:919:18)
    at Server._symbolicate (프로젝트경로\node_modules\metro\src\Server.js:992:22)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Server._processRequest (프로젝트경로\node_modules\metro\src\Server.js:403:7) {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: '프로젝트경로\\프로젝트명\\http:\\localhost:8081\\index.bundle?platform=android&dev=true&minify=false&app=com.프로젝트명&modulesOnly=false&runModule=true'
}
Error: ENOENT: no such file or directory, open '프로젝트경로\http:\localhost:8081\index.bundle?platform=android&dev=true&minify=false&app=com.프로젝트명&modulesOnly=false&runModule=true'
    at Object.openSync (node:fs:585:3)
    at Object.readFileSync (node:fs:453:35)
    at getCodeFrame (프로젝트경로\node_modules\metro\src\Server.js:919:18)
    at Server._symbolicate (프로젝트경로\node_modules\metro\src\Server.js:992:22)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Server._processRequest (프로젝트경로\node_modules\metro\src\Server.js:403:7) {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: '프로젝트경로\\프로젝트명\\http:\\localhost:8081\\index.bundle?platform=android&dev=true&minify=false&app=com.프로젝트명&modulesOnly=false&runModule=true'
}
 ERROR  TypeError: undefined is not a function, js engine: hermes
 ERROR  Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.
      This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes
 ERROR  Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.
      This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes

일단 문제가 됐던 오류 로그는 이랬다.

 

앱 리프레시하다 떠서 너무 당황한 나머지 npm 다 재설치하는 등 온갖 방법을 써봤는데, 그냥 node 혹은 gradle 쪽 캐시 문제였던 모양이다.

#Win
cd android && gradlew clean && cd .. && react-native run-android

#osX
cd android && bash gradlew clean && cd .. && react-native run-android
npx react-native start "--reset-cache"

이정도로 해결.

이 문제로 몇 시간을 날린 게 억울해서 백업해둔다.

COMMENT