Android Studio gradle error on image file

I’m assembling a flavor and it seems to be choking on a particular PNG. pngcheck reports it OK so I’m not sure where else to go.

java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.3.0-5013011-windows Daemon #4: Unexpected error during compile 'E:\Development\Repositories\PropertyForce\superapp-android-current\app\src\AgentResource\res\drawable-hdpi\bg.png', attempting to stop daemon. This should not happen under normal circumstances, please file an issue if it does. > com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.3.0-5013011-windows Daemon #4: Unexpected error during compile 'E:\Development\Repositories\PropertyForce\superapp-android-current\app\src\AgentResource\res\drawable-hdpi\bg.png', attempting to stop daemon. This should not happen under normal circumstances, please file an issue if it does. > AAPT2 aapt2-3.3.0-5013011-windows Daemon #4: Unexpected error during compile 'E:\Development\Repositories\PropertyForce\superapp-android-current\app\src\AgentResource\res\drawable-hdpi\bg.png', attempting to stop daemon. This should not happen under normal circumstances, please file an issue if it does. > AAPT2 process unexpectedly exit. Error output:

org.gradle.api.tasks.TaskExecutionException

: 

Execution failed for task ':app:mergeAgentResourceReleaseResources'.

Open stacktrace

Caused by: 

org.gradle.internal.UncheckedException

: 

java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.3.0-5013011-windows Daemon #4: Unexpected error during compile 'E:\Development\Repositories\PropertyForce\superapp-android-current\app\src\AgentResource\res\drawable-hdpi\bg.png', attempting to stop daemon. This should not happen under normal circumstances, please file an issue if it does.

Open stacktrace

Caused by: 

java.util.concurrent.ExecutionException

: 

com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.3.0-5013011-windows Daemon #4: Unexpected error during compile 'E:\Development\Repositories\PropertyForce\superapp-android-current\app\src\AgentResource\res\drawable-hdpi\bg.png', attempting to stop daemon. This should not happen under normal circumstances, please file an issue if it does.

Open stacktrace

Caused by: 

com.android.builder.internal.aapt.v2.Aapt2InternalException

: 

AAPT2 aapt2-3.3.0-5013011-windows Daemon #4: Unexpected error during compile 'E:\Development\Repositories\PropertyForce\superapp-android-current\app\src\AgentResource\res\drawable-hdpi\bg.png', attempting to stop daemon. This should not happen under normal circumstances, please file an issue if it does.

Open stacktrace

Caused by: 

java.io.IOException

: 

AAPT2 process unexpectedly exit. Error output:

Close stacktrace

at com.android.builder.internal.aapt.v2.Aapt2DaemonImpl$WaitForTaskCompletion.err(Aapt2DaemonImpl.kt:309)

at com.android.builder.internal.aapt.v2.Aapt2DaemonImpl$processOutput$1.err(Aapt2DaemonImpl.kt:75)

at com.android.utils.GrabProcessOutput$1.run(GrabProcessOutput.java:104)

I have this error too, with one particular .png file, and on Windows only, not Mac. Did you manage to figure it out?

Most of them were resolved by having our graphic designer resave them as PNGs from the original source. The file size went down significantly in the process. There is one image left (seems normal size) that is still causing the problem and I haven’t figured that one out. Does your problematic image seem unusually large?