Search code examples
androidreact-native

React-Native Build Failed app:mergeDebugAssets


I completed a react-native app for Android, and now when I try to

run npm android, I get this error:

 FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugAssets'.
> Error: java.lang.RuntimeException: java.lang.RuntimeException: java.nio.file.AccessDeniedException:
C:\Users\SONY\AwesomeProject\android\app\build\intermediates\merged_assets\debug\mergeDebugAssets\out\fonts

Please can you help me?

Many Thanks

React-native

Caused by: java.nio.file.AccessDeniedException: C:\Users\SONY\AwesomeProject\android\app\build\intermediates\merged_assets\debug\mergeDebugAssets\out\fonts at com.android.ide.common.resources.MergedAssetWriter$AssetWorkAction.run(MergedAssetWriter.java:84) ... 1 more

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:mergeDebugAssets'.

    Error: java.lang.RuntimeException: java.lang.RuntimeException: java.nio.file.AccessDeniedException: C:\Users\SONY\AwesomeProject\android\app\build\intermediates\merged_assets\debug\mergeDebugAssets\out\fonts

I want to successfully build the android app


Solution

  • Try running this inside your project directory:

    1. cd android
    2. gradlew clean or ./gradlew clean
    3. cd ..
    4. react-native run-android