Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Execution failed for task ':app:mergeReleaseResources' building APK

After trying to build APK once and fixing an error, I got an error executing ./gradlew assembleRelease again: Execution failed for task ':app:mergeReleaseResources' building APK

like image 603
Lucas Mendes Mota Da Fonseca Avatar asked Oct 04 '18 17:10

Lucas Mendes Mota Da Fonseca


4 Answers

The problem occured becaused when I tried to build once, it has created drawables dirs on android/app/src/main/res/. Then when I tried on second time, it has shown me this error Execution failed for task ':app:mergeReleaseResources' building APK

I just deleted the drawable-* dirs and it worked.

Hope it helps!

enter image description here

rm -rf android/app/src/main/res/drawable-*

enter image description here

like image 95
Lucas Mendes Mota Da Fonseca Avatar answered Oct 24 '22 06:10

Lucas Mendes Mota Da Fonseca


As addition to accepted answer, if there is a "raw" folder in the same directory, also you must delete that.

like image 34
MMYurt Avatar answered Oct 24 '22 06:10

MMYurt


I just deleted the drawable-* dirs as well raw dir from

android/app/src/main/res/ and it worked.

like image 12
Munna Kumar Avatar answered Oct 24 '22 06:10

Munna Kumar


Exactly problem occurred when I tried to build once, it has created drawable dirs. I was facing following issue:

Execution failed for task ':app:mergeReleaseResources'.

java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.3.0-5013011-windows Daemon #0: Unexpected error during compile 'E:\project\ionic\uvparentlan0.4\platforms\android\app\src\main\res\drawable-land-xxxhdpi\screen.png', attempting to stop daemon. This should not happen under normal circumstances, please file an issue if it does.

Solution: I delete all drawable directories named "drawable-port-*****"

Now Build again " ionic cordova build --release android "

BUILD SUCCESSFUL in 1m 11s 42 actionable tasks: 40 executed, 2 up-to-date Built the following apk(s):

like image 1
Muhammad Azeem Avatar answered Oct 24 '22 07:10

Muhammad Azeem