• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

I'm getting an error when I build my react native based android app to expo.

I've tried to build my react native based app to expo running "eas build -p android" command using Visual Studio Code. Unfortunately build process failed while "run gradlew" phase. How can I fix this failure?
Error log message from expo is as follow:

2069[stderr] FAILURE: Build completed with 2 failures.
2070[stderr] 1: Task failed with an exception.
2071[stderr] -----------
2072[stderr] * What went wrong:
2073[stderr] Execution failed for task ':app:mergeReleaseResources'.
2074[stderr] > A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
2075[stderr] > Android resource compilation failed
2076[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.
2077[stderr]
2078[stderr] * Try:
2079[stderr] > Run with --stacktrace option to get the stack trace.
2080[stderr] > Run with --info or --debug option to get more log output.
2081[stderr] > Run with --scan to get full insights.
2082[stderr] ==============================================================================
2083[stderr] 2: Task failed with an exception.
2084[stderr] -----------
2085[stderr] * What went wrong:
2086[stderr] java.lang.StackOverflowError (no error message)
2087[stderr] * Try:
2088[stderr] > Run with --stacktrace option to get the stack trace.
2089[stderr] > Run with --info or --debug option to get more log output.
2090[stderr] > Run with --scan to get full insights.
2091[stderr] ==============================================================================
2092[stderr] * Get more help at Gradle | Search for Help with Gradle Build Tool
2093[stderr] BUILD FAILED in 7m 14s
2094Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
Build process on expo is:
expo_build.png
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones