Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reload app on android device issue on windows (ERROR EBUSY: resource busy or locked) #13022

Closed
farhan687 opened this issue Mar 20, 2017 · 8 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@farhan687
Copy link

farhan687 commented Mar 20, 2017

Description

I have connected android device and then I ran following commands on different terminal tabs:
react-native start
react-native run-android

App is working fine for the first time.
After changing the content in index.android.js file, I tap Reload option from dev menu of the device, and then it shows analyzing and start transforming modules for couple of seconds and suddenly it stops with the following error.

native-error

`
ERROR EBUSY: resource busy or locked,
rename 'C:\Users\Farhan\AppData\Local\Temp\react-native-packager-cache-bc7c6964\1f\ad664aAppRegistry.js.meta.4164767065' -> 'C:\Users\Farhan\AppData\Local\Temp\react-native-packager-cache-bc7c6964\1f\ad664aAppRegistry.js.meta'
{"errno":-4082,"code":"EBUSY","syscall":"rename","path":"C:\Users\Farhan\AppData\Local\Temp\react-native-packager-cache-bc7c6964\1f\ad664aAppRegistry.js.meta.4164767065","dest":"C:\Users\Farhan\AppData\Local\Temp\react-native-packager-cache-bc7c6964\1f\ad664aAppRegistry.js.meta"}
Error: EBUSY: resource busy or locked, rename 'C:\Users\Farhan\AppData\Local\Temp\react-native-packager-cache-bc7c6964\1f\ad664aAppRegistry.js.meta.4164767065' -> 'C:\Users\Farhan\AppData\Local\Temp\react-native-packager-cache-bc7c6964\1f\ad664aAppRegistry.js.meta'
at Error (native)
at Object.fs.renameSync (fs.js:809:18)
at writeFileSync (E:\Work\appbaseWork\native\HelloWorld\node_modules\write-file-atomic\index.js:95:8)
at Object.writeSync (E:/Work/appbaseWork/native/HelloWorld/node_modules/react-native/packager/src/lib/TransformCache.js:138:3)
at _getTransformedCode (E:/Work/appbaseWork/native/HelloWorld/node_modules/react-native/packager/src/node-haste/Module.js:296:22)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)

See http://facebook.github.io/react-native/docs/troubleshooting.html
for common problems and solutions.
`

It looks like npm issue with windows. It would be very helpful if anybody can provide me solution or any helpful link to get rid off this issue.

Reproduction

Steps:
On windows 10

  • react-native start
  • react-native run-android
  • change contend and tap reload option on device

Additional Information

  • React Native version: 0.42.2
  • Platform: Android
  • Operating System: Windows 10
  • Dev tools: Android device - android version 5.1.1
@hramos
Copy link
Contributor

hramos commented May 25, 2017

We're cutting down on the number of outstanding issues, in order to allow us to focus. I'm closing this issue because it has been open for over 60 days with no activity. If you think it should still be opened let us know why. PRs are always welcome.

@hramos hramos closed this as completed May 25, 2017
@hramos hramos added the Icebox label May 26, 2017
@phamhuyhoang95
Copy link

I have the same issue, after running well few time I get exactly what happened to him the problem still exist!

OS: window 10
react-native-cli: 2.0.1
react-native: 0.45.1
emulator: Genymotion
npm version: 5.0.3
nodejs : 4.3.0
error

I try to remove node_modules folder and reinstall again but nothing work

@Ehsan0007
Copy link

Ehsan0007 commented Jul 19, 2017

i have also same issue after building app packeger loader give error
image

OS : Windows 10
npm Version :3.10.10
react-native: "0.44.0",
emulator : GenyMotion

@phamhuyhoang95
Copy link

@Ehsan0007 you must to uninstall the stupid anti-malware win 10 it blocks react native packager from generating app file. Just remove it and you can start app
Hope it help

@sabiya115
Copy link

i have also same issue, any suggestions would be helpful.

Bundling index.android.js [development, non-minified, hmr enabled] 0.0% (1/563), failed.
Error: EBUSY: resource busy or locked, rename 'C:\Users\admin\AppData\Local\Temp\react-native-packager-cache-14500f530db20da864db142a5d2446251200d698\cache\6c\b1190407433b50f6c3dc6af5d8e91f3bff2431.947356251' -> 'C:\Users\admin\AppData\Local\Temp\react-native-packager-cache-14500f530db20da864db142a5d2446251200d698\cache\6c\b1190407433b50f6c3dc6af5d8e91f3bff2431'
at Error (native)
at Object.fs.renameSync (fs.js:810:18)
at writeFileSync (d:\sabiya\PROJECTS\AndroidCaliva\Caliva_Android\node_modules\write-file-atomic\index.js:124:8)
at FileBasedCache.writeSync (d:\sabiya\PROJECTS\AndroidCaliva\Caliva_Android\node_modules\metro-bundler\src\lib\TransformCaching.js:138:5)
at d:\sabiya\PROJECTS\AndroidCaliva\Caliva_Android\node_modules\metro-bundler\src\node-haste\Module.js:302:38
at next (native)
at step (d:\sabiya\PROJECTS\AndroidCaliva\Caliva_Android\node_modules\metro-bundler\src\node-haste\Module.js:13:445)
at d:\sabiya\PROJECTS\AndroidCaliva\Caliva_Android\node_modules\metro-bundler\src\node-haste\Module.js:13:605
at process._tickCallback (internal/process/next_tick.js:109:7)
Error: EBUSY: resource busy or locked, rename 'C:\Users\admin\AppData\Local\Temp\react-native-packager-cache-14500f530db20da864db142a5d2446251200d698\cache\6c\b1190407433b50f6c3dc6af5d8e91f3bff2431.947356251' -> 'C:\Users\admin\AppData\Local\Temp\react-native-packager-cache-14500f530db20da864db142a5d2446251200d698\cache\6c\b1190407433b50f6c3dc6af5d8e91f3bff2431'
at Error (native)
at Object.fs.renameSync (fs.js:810:18)
at writeFileSync (d:\sabiya\PROJECTS\AndroidCaliva\Caliva_Android\node_modules\write-file-atomic\index.js:124:8)
at FileBasedCache.writeSync (d:\sabiya\PROJECTS\AndroidCaliva\Caliva_Android\node_modules\metro-bundler\src\lib\TransformCaching.js:138:5)
at d:\sabiya\PROJECTS\AndroidCaliva\Caliva_Android\node_modules\metro-bundler\src\node-haste\Module.js:302:38
at next (native)
at step (d:\sabiya\PROJECTS\AndroidCaliva\Caliva_Android\node_modules\metro-bundler\src\node-haste\Module.js:13:445)
at d:\sabiya\PROJECTS\AndroidCaliva\Caliva_Android\node_modules\metro-bundler\src\node-haste\Module.js:13:605
at process._tickCallback (internal/process/next_tick.js:109:7)
Error: EBUSY: resource busy or locked, rename 'C:\Users\admin\AppData\Local\Temp\react-native-packager-cache-14500f530db20da864db142a5d2446251200d698\cache\6c\b1190407433b50f6c3dc6af5d8e91f3bff2431.947356251' -> 'C:\Users\admin\AppData\Local\Temp\react-native-packager-cache-14500f530db20da864db142a5d2446251200d698\cache\6c\b1190407433b50f6c3dc6af5d8e91f3bff2431'
at Error (native)
at Object.fs.renameSync (fs.js:810:18)
at writeFileSync (d:\sabiya\PROJECTS\AndroidCaliva\Caliva_Android\node_modules\write-file-atomic\index.js:124:8)
at FileBasedCache.writeSync (d:\sabiya\PROJECTS\AndroidCaliva\Caliva_Android\node_modules\metro-bundler\src\lib\TransformCaching.js:138:5)
at d:\sabiya\PROJECTS\AndroidCaliva\Caliva_Android\node_modules\metro-bundler\src\node-haste\Module.js:302:38
at next (native)
at step (d:\sabiya\PROJECTS\AndroidCaliva\Caliva_Android\node_modules\metro-bundler\src\node-haste\Module.js:13:445)
at d:\sabiya\PROJECTS\AndroidCaliva\Caliva_Android\node_modules\metro-bundler\src\node-haste\Module.js:13:605
at process._tickCallback (internal/process/next_tick.js:109:7)

@nukes88
Copy link

nukes88 commented Jan 29, 2018

has this ever been fixed?

@RiBj1993
Copy link

npm install --save

@senthilkumar04
Copy link

senthilkumar04 commented Apr 20, 2018

@farhan687 @phamhuyhoang95 This is due to the security restrictions which is made on your AppData folder. The packager which starts automatically when building the package does not have admin privileges. So follow the steps to fix it:

  1. Start the packager in a seperate cmd from the project folder : react-native start "project-name" --port xxxx
  2. Run "react-native run-android --port xxxx" from your project folder
  3. After the app loads go to the developer options by pressing Ctrl + M (Windows) and in the debud server host type : "localhost:xxxx"

The port number has to be same in the commands.
It worked for me !!! 👍

@facebook facebook locked as resolved and limited conversation to collaborators May 29, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

10 participants