I can't build expo app (:app:mergeReleaseResources) - react-native

I build expo app yesterday.
But I can't build expo app today (another app).
I don't update at all.
I search google but can't get any answer
exp build:android
this is expo app build log
FAILED
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:mergeReleaseResources'.
[stderr] > java.util.concur rent.ExecutionException:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource
compilation failed
[stderr] /app/turtle/workingdir/android/sdk33/android-shell-
app/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: error: failed to read PNG
signature: file does not start with PNG signature.
[stderr] * Try:
[stderr] 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.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 43s
`

I was facing this issue too, and I resolved it by using "expo-cli build:android -t apk" instead of "exp build:android". This built the apk without any errors and all the images rendered perfectly.
Make sure you have expo-cli installed.

Related

Problem with unimodules-permissions-interface when exporting

I have an app that I was developing and it was exporting correctly until I upgraded to EAS. Now with npm start it emulates well, it works correctly but the APK is not generated. What it tells me in the build is the following:
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':unimodules-permissions-interface:compileReleaseJavaWithJavac'.
[stderr] > Compilation failed; see the compiler error output for details.
[stderr] * Try:
[stderr] 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.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 4m 12s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings
438 actionable tasks: 438 executed
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

react native expo - Execution failed for task ':expo-updates:compileReleaseKotlin'

In order to add OTA updates functionality, I installed expo-updates package and before that I configured expo-modules#latest in my react native bare project. Everything worked fine, build successfully, but when I execute the command eas build -p android --profile preview, it crashes/build-fails after 6 mins due to the following error:
[stderr] FAILURE: Build completed with 2 failures.
[stderr] 1: Task failed with an exception.
[stderr] -----------
[stderr] * What went wrong:
[stderr] Execution failed for task ':expo-updates:compileReleaseKotlin'.
[stderr] > A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
[stderr] > Compilation error. See log for more details
[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 53s
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
I searched for hours related to this issue and found something similar here https://github.com/expo/expo/issues/19259#issuecomment-1259724391, applied the changes, and it is still throwing the same build everytime... Everything works in development though, no crashes there...
My env:
{
...,
"dependencies": {
"react": "18.1.0",
"react-native": "0.70.0",
"expo": "^46.0.0",
"expo-updates": "~0.14.6",
},
...
}
I am not able to create a build due to this error, if someone could help, I would really appreciate it!
Feel free to ask any more details if needed!

EAS build failing due to internal issue

I am trying to migrate from classical builds to eas but the builds are failing due to some internal reason.
This happened with both bare and managed workflows,
Expo Cli version : 5.2.0
Expo SDK Version : 44.0.0
Here is the error log :
Task :react-native-webview:compileReleaseRenderscript NO-SOURCE
Task :react-native-webview:generateReleaseResValues
Task :react-native-webview:generateReleaseResources
Task :react-native-webview:packageReleaseResources
Task :unimodules-task-manager-interface:compileReleaseRenderscript NO-SOURCE
Task :unimodules-task-manager-interface:generateReleaseResValues
Task :unimodules-task-manager-interface:generateReleaseResources
Task :unimodules-task-manager-interface:packageReleaseResources
Task :app:mergeReleaseResources
Task :app:mergeReleaseResources FAILED
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ‘:app:mergeReleaseResources’.
[stderr] >
[stderr] A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[stderr] > Android resource compilation failed
[stderr] /home/expo/workingdir/build/android/app/build/intermediates/incremental/mergeReleaseResources/merged.dir/values/values.xml:7078: AAPT: error: duplicate value for resource ‘attr/show_buffering’ with config ‘’.
[stderr]
[stderr] /home/expo/workingdir/build/android/app/build/intermediates/incremental/mergeReleaseResources/merged.dir/values/values.xml:7078: AAPT: error: resource previously defined here.
[stderr]
[stderr] /home/expo/workingdir/build/android/app/build/intermediates/incremental/mergeReleaseResources/merged.dir/values/values.xml: AAPT: error: file failed to compile.
[stderr]
[stderr] * Try:
[stderr] 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.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 5m 47s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use ‘–warning-mode all’ to show the individual deprecation warnings.
See Command-Line Interface
167 actionable tasks: 167 executed
Error: Gradle build failed with unknown error. See logs for the “Run gradlew” phase for more information.
Please advise.

react-native-appearance make a gradle error

Hey i have a error with gradle on my react native app (when i run yarn android)
yarn run v1.22.17
$ react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 980 file(s) to forward-jetify. Using 32 workers...
info JS server already running.
info Installing the app...
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file 'C:\Users\user\Documents\project react native\appfirst\node_modules\react-native-appearance\android\build.gradle' line: 23
* What went wrong:
A problem occurred evaluating project ':react-native-appearance'.
> Plugin with id 'maven' not found.
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':react-native-appearance'.
> com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
* 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 6s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file 'C:\Users\user\Documents\project react native\appfirst\node_modules\react-native-appearance\android\build.gradle' line: 23
* What went wrong:
A problem occurred evaluating project ':react-native-appearance'.
> Plugin with id 'maven' not found.
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':react-native-appearance'.
> com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
* 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 6s
at makeError (C:\Users\roro3\Documents\project react native\appfirst\node_modules\execa\index.js:174:9)
at C:\Users\roro3\Documents\project react native\appfirst\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (C:\Users\roro3\Documents\project react native\appfirst\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\Users\roro3\Documents\project react native\appfirst\node_modules\#react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I see a error with react-native-appearance but i don't understand why.
I got this error after instalation of some package (react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context #react-native-community/masked-view)
I also got into some problems with the react-native-appearence package. If you use expo you shouldn't have this problem or just update the package to version 0.3.4.
If you use use the react-native-cli the only option for you is to downgrade your react-native to a version which is using Gradle 6. You can find more information here about this issue.

Getting an "Android resource compilation failed" error while trying to build my react native app using expo

I am trying to build an android apk of my react native app. I was trying two commands expo-cli build:android -t apk and expo build:android. But I am getting this error repeatedly. If anyone can give any clue about this error please do the help :')
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:mergeReleaseResources'.
[stderr] > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[stderr] > Android resource compilation failed
[stderr] /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/res/values/colors.xml:13:3-57: AAPT: error: invalid color.
[stderr]
[stderr] /app/turtle/workingdir/android/sdk41/android-shell-app/app/build/intermediates/incremental/mergeReleaseResources/merged.dir/values/values.xml: AAPT: error: file failed to compile.
[stderr]
[stderr] * Try:
[stderr] 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.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 31s
I have attached a screenshot of the error I am getting. Please give a look.
Build failed with an exception.