React-native: 'Could not read path' build failed error

Created on 3 Sep 2017  路  9Comments  路  Source: facebook/react-native

Is this a bug report?

Yes

Environment

  1. react-native -v: 0.47.2
  2. node -v: 8.1.2
  3. npm -v: 5.3
  4. yarn --version : 0.27.5

Then, specify:

  • Target Platform: Android

  • Development Operating System: Windows 10 64 bit

  • Build tools: Both android emulator and physical Galaxy S6

Steps to Reproduce

(Write your steps here:)

  1. cd android && gradlew clean
  2. cd ..
  3. react-native run-android
  4. disconnect packager
  5. react-native run-android

Expected Behavior

Build is expected to run just fine the second time, just like the first time.

(Write what you thought would happen.)

Actual Behavior

When I run react-native run-android, the first time I run it, everything runs fine. If I stop the packager and run react-native run-android a second time, I get this error:

FAILURE: Build failed with an exception.

* What went wrong:
Could not read path 'C:\ig3\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-fr-rCA'.
> C:\ig3\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-fr-rCA

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

I can do 'cd android && gradlew clean' then the build will run fine, but again the next time I run, I will get the same error. It is always the second time I run my build after doing gradlew clean, I get the same error.

Any help would be much appreciated. Thanks!

Locked

Most helpful comment

For me the issue is solved when I'm closing Android Studio. I'm guessing that Android Studio is keeping handle to the files and paths which preventing react-native run-android run correctly.

All 9 comments

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

I have the some problem. If you have found solution, can you share it @jslok

Unfortunately i still have this issue.

I have the same issue

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

Still getting this all the time, including with rename/delete path. Usually just have to try it a couple more times until everything goes through.

Hey guys, had the same issue when i was renaming my packages in android studio, what worked for me can be found from this link https://stackoverflow.com/questions/23025433/how-to-clear-gradle-cache/30450020#30450020

For me the issue is solved when I'm closing Android Studio. I'm guessing that Android Studio is keeping handle to the files and paths which preventing react-native run-android run correctly.

Seems like the issue can be worked around. Closing.

Was this page helpful?
0 / 5 - 0 ratings