Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 606
Judy Avatar asked Jun 13 '19 13:06

Judy


4 Answers

Try running this inside your project directory:

  1. cd android
  2. gradlew clean
  3. cd..
  4. react-native run-android
like image 136
3iL Avatar answered Nov 06 '22 05:11

3iL


I had this issue and for me ./gradlew clean didn't help.

But I found a file called assets in android/app/src/main that git showed as untracked. When I removed the assets file I could build the project without problems again.

I use Android Studio for debugging java code and I would guess that is why the assets file was created.

like image 32
Bjørnar Hvidsten Avatar answered Nov 06 '22 05:11

Bjørnar Hvidsten


For Linux / MacOS- ./gradlew clean

Windows PowerShell- .\gradlew clean

Windows cmd- gradlew clean

like image 4
Sumj25 Avatar answered Nov 06 '22 05:11

Sumj25


If you have installed react-native-vector-icons, try to unlink it by using this command

react-native unlink react-native-vector-icons

like image 3
Raouf Mourtada Avatar answered Nov 06 '22 05:11

Raouf Mourtada