Problem with unimodules-permissions-interface when exporting - react-native

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.

Related

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!

Execution failed for task ':app:checkDebugAarMetadata'. react native

PS D:\MOTOR\kawawamotorsreactapp> npx react-native run-android
warn Package react-native-vector-icons contains invalid configuration: "dependency.assets" is not allowed.
Please verify it's properly linked using "react-native config" command and contact the package maintainers
about this.
info Starting JS server...
info Installing the app...
Task :app:checkDebugAarMetadata FAILED
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
94 actionable tasks: 41 executed, 53 up-to-date
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.appcompat:appcompat:1.4.1.
AAR metadata file: C:\Users\BIBEK.gradle\caches\transforms-3\0e660b8bafa777eda46724d78ef391ea\transformed\appcompat-1.4.1\META-INF\com\android\build\gradle\aar-metadata.properties.
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 1m 12s
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 failed with an exception.
What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.appcompat:appcompat:1.4.1.
AAR metadata file: C:\Users\BIBEK.gradle\caches\transforms-3\0e660b8bafa777eda46724d78ef391ea\transformed\appcompat-1.4.1\META-INF\com\android\build\gradle\aar-metadata.properties.
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 1m 12s
at makeError (D:\MOTOR\kawawamotorsreactapp\node_modules\execa\index.js:174:9)
at D:\MOTOR\kawawamotorsreactapp\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (D:\MOTOR\kawawamotorsreactapp\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (D:\MOTOR\kawawamotorsreactapp\node_modules\#react-native-community\cli\build\index.js:142:9)
info Run CLI with --verbose flag for more details.

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.

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.

I can't build expo app (:app:mergeReleaseResources)

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.