Today I built a react native app and it worked perfectly. After that I changed one number within an array that cannot have any impact on the build failing. The app is working perfectly in the Expo Go app on my phone.
Still, when I tried to build the app again the following error appeared - three times in a row. I looked in the internet for a solution but could not find a clear answer. It seems to have different causes depending on the expo-cli version and so on.
Error log (only the lines marked in red color (errors) due to letter restriction (EDIT: Link to full log: https://justpaste.it/56lge)):
EDIT: I just deleted the app icon and splash screen image and set them back to default and then it worked again. I noticed that my icon was a jpeg whereas the original is a png but the documentation says that jpeg is supported. I just built again with my splash screen image but still using the original expo app icon. This means that the icon was the problem.
[stderr]
Note: Some input files use or override a deprecated API.
[stderr]
Note: Recompile with -Xlint:deprecation for details.
[stderr]
Note: Some input files use or override a deprecated API.
[stderr]
Note: Recompile with -Xlint:deprecation for details.
[stderr]
FAILURE: Build completed with 2 failures.
[stderr]
1: Task failed with an exception.
[stderr]
-----------
[stderr]
* What went wrong:
[stderr]
Execution failed for task ':app:mergeReleaseResources'.
[stderr]
> Multiple task action failures occurred:
[stderr]
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
[stderr]
> Android resource compilation failed
[stderr]
ERROR:/home/expo/workingdir/build/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: AAPT: error: file failed to compile.
[stderr]
[stderr]
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
[stderr]
> Android resource compilation failed
[stderr]
ERROR:/home/expo/workingdir/build/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: AAPT: error: file failed to compile.
[stderr]
[stderr]
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
[stderr]
> Android resource compilation failed
[stderr]
ERROR:/home/expo/workingdir/build/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: AAPT: error: file failed to compile.
[stderr]
[stderr]
* Try:
[stderr]
> Run with --stacktrace option to get the stack trace.
[stderr]
> Run with --info or --debug option to get more log output.
[stderr]
> Run with --scan to get full insights.
[stderr]
==============================================================================
[stderr]
2: Task failed with an exception.
[stderr]
-----------
[stderr]
* What went wrong:
[stderr]
java.lang.StackOverflowError (no error message)
[stderr]
* Try:
[stderr]
> Run with --stacktrace option to get the stack trace.
[stderr]
> Run with --info or --debug option to get more log output.
[stderr]
> Run with --scan to get full insights.
[stderr]
==============================================================================
[stderr]
* Get more help at https://help.gradle.org
[stderr]
BUILD FAILED in 4m 15s
221 actionable tasks: 221 executed
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.