I’m running into a frustrating issue while trying to bundle my Expo React Native app for production. The app is relatively simple and doesn’t use any native Android or iOS components. However, when I attempt to build the app, I’m encountering a couple of issues that I need help resolving:
Gradle Build Error:
The build process eventually fails with the following error:
Task :app:processReleaseMainManifest
/home/expo/workingdir/build/android/app/src/main/AndroidManifest.xml Warning:
provider#expo.modules.filesystem.FileSystemFileProvider@android:authorities was tagged at AndroidManifest.xml:0 to replace other declarations but no other declaration present
Task :app:mergeReleaseResources FAILED
Task :expo-asset:compileReleaseJavaWithJavac
Task :expo-constants:compileReleaseKotlin
Task :app:processReleaseManifest
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ‘:app:mergeReleaseResources’.
A failure occurred while executing com.android.build.gradle.internal.res.ResourceCompilerRunnable
Resource compilation failed (Failed to compile values resource file /home/expo/workingdir/build/android/app/build/intermediates/incremental/release/mergeReleaseResources/merged.dir/values/values.xml. Cause: java.lang.IllegalStateException: Can not extract resource from com.android.aaptcompiler.ParsedResource@36d79d7c.,Can not extract resource from com.android.aaptcompiler.ParsedResource@2c08c75f.). Check logs for more details.
- Try:
Run with –stacktrace option to get the stack trace.
Run with –info or –debug option to get more log output.
Run with –scan to get full insights.
Get more help at https://help.gradle.org.
BUILD FAILED in 7m 14s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use ‘–warning-mode all’ to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.6/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
410 actionable tasks: 410 executed
Error: Gradle build failed with unknown error. See logs for the “Run gradlew” phase for more information.
The full error log points to issues with resource compilation in Gradle, but the root cause is not immediately clear.
Context:
Expo SDK Version: ~51.0.22
React Native Version: ^0.74.3
Dependencies: A large number of dependencies, including but not limited to expo, react, react-native, and various community packages.
What I’ve Tried:
Updated all dependencies to their latest versions.
Cleared Expo and npm/yarn caches.
Verified compatibility of dependencies with the Expo SDK version.
Questions:
What could be causing these warnings about multiple property definitions in the bundled assets? How can I address or suppress these warnings?
What steps can I take to resolve the Gradle build error related to resource compilation? Are there specific areas in the Gradle configuration or project setup that I should check?
I don’t have any android files like xml or build.gradle.
Are there any additional debugging steps I should take to diagnose and fix these issues?
I appreciate any advice or guidance you can provide. Thanks in advance for your help!