I've an error when I was building my react native based android app to expo client

I’ve tried to build my app running “eas build -p android” command and build was failed while “run gradlew” phase as following error:

[stderr]

FAILURE: Build completed with 2 failures.

1925[stderr]

1: Task failed with an exception.

1926[stderr]

-----------

1927[stderr]

* What went wrong:

1928[stderr]

Execution failed for task ':app:mergeReleaseResources'.

1929[stderr]

> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable

1930[stderr]

   > Android resource compilation failed

1931[stderr]

     ERROR:/home/expo/workingdir/build/android/app/build/generated/res/react/release/drawable-mdpi/assets_logo_header.png: AAPT: error: file failed to compile.

1932[stderr]

         

1933[stderr]

* Try:

1934[stderr]

> Run with --stacktrace option to get the stack trace.

1935[stderr]

> Run with --info or --debug option to get more log output.

1936[stderr]

> Run with --scan to get full insights.

1937[stderr]

==============================================================================

1938[stderr]

2: Task failed with an exception.

1939[stderr]

-----------

1940[stderr]

* What went wrong:

1941[stderr]

java.lang.StackOverflowError (no error message)

1942[stderr]

* Try:

1943[stderr]

> Run with --stacktrace option to get the stack trace.

1944[stderr]

> Run with --info or --debug option to get more log output.

1945[stderr]

> Run with --scan to get full insights.

1946[stderr]

==============================================================================

1947[stderr]

* Get more help at https://help.gradle.org

1948[stderr]

BUILD FAILED in 7m 29s

1949

Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
Execution failed for task ':app:mergeReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
   > Android resource compilation failed
     ERROR:/home/expo/workingdir/build/android/app/build/generated/res/react/release/drawable-mdpi/assets_logo_header.png: AAPT: error: file failed to compile.

So you should probably ask in some Android community what is wrong here, as your problem seems not to be Gradle related.

1 Like