Execution failed for task ':expo:compileReleaseKotlin' - android

I am building a react native app using eas. Its failing each time i try and i have no idea what could be the issue. `this is the error its showing
Task :expo:compileReleaseKotlin FAILED1470
[stderr] e: /home/expo/workingdir/build/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapperBase.kt: (50, 3): 'getUIImplementationProvider' overrides nothing1471
[stderr] e: /home/expo/workingdir/build/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapperBase.kt: (50, 76): Unresolved reference: UIImplementationProvider1472
[stderr] e: /home/expo/workingdir/build/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapperBase.kt: (51, 12): Not enough information to infer type variable T1473>
Task :expo-modules-core:buildCMakeRelWithDebInfo[x86_64]1474w:
Detected multiple Kotlin daemon sessions at build/kotlin/sessions1475Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.1476You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.1477See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings1478Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.1479Please consult deprecation warnings for more details.1480377 actionable tasks: 377 executed1481
[stderr] FAILURE: Build failed with an exception.1482
[stderr] * What went wrong:1483[stderr] Execution failed for task ':expo:compileReleaseKotlin'.1484[stderr] > A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction1485[stderr] > Compilation error. See log for more details1486
[stderr] * Try:1487[stderr] > Run with --stacktrace option to get the stack trace.1488[stderr] > Run with --info or --debug option to get more log output.1489[stderr] > Run with --scan to get full insights.1490[stderr] * Get more help at https://help.gradle.org1491[stderr] BUILD FAILED in 5m 47s1492Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
i have tried un installing and reinstalling expo cli on machine which is using linux(Crostini to be precise) because some of the errors it was highlighting were deprecation errors of some of the installed modules. ive tried building it a number of times, revisiting my code and searching online hoping that i may i be able to pin point where its going wrong

The solution that worked for me is to upgrade your react native package to the patch version as described here: https://github.com/facebook/react-native/issues/35210

Related

Build fails when I run android cordova after just creating the empty project

I'm on Windows 10, I have installed Java 19 and Gradle 7.6 and I set the environment path variable.
I'm trying to run a cordova android app i just created, I didn't add anything from the base project, I just ran the inital commands cordova create app-vita cd app-vita cordova add platform android cordova run android and after the last command i get
> Task :app:processDebugMainManifest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module #1a261029
* 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
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.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 21s
34 actionable tasks: 34 executed
Command failed with exit code 1: D:\app-vita\platforms\android\gradlew cdvBuildDebug -b D:\app-vita\platforms\android\build.gradle
I really don't know what to do, I haven't done anything except creating the project

Android studio: FAILURE: Build failed with an exception. settings.gradle

I am trying to compile an IONIC app using android studio and I get this error message. Could anyone please give me some advice how to sort this out?
where to look after this issue and how to resolve it.
Many thanks
FAILURE: Build failed with an exception.
Where: Settings file ‘C:\Users\Samsung PC\Desktop\user\platforms\android\settings.gradle’
What went wrong: Could not compile settings file ‘C:\Users\Samsung PC\Desktop\user\platforms\android\settings.gradle’. > startup failed: General error during conversion: Unsupported class file major version 62
java.lang.IllegalArgumentException: Unsupported class file major version 62
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:189)
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:170)
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:156)
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:277)
at org.codehaus.groovy.ast.decompiled.AsmDecompiler.parseClass(AsmDecompiler.java:81)
at org.codehaus.groovy.control.ClassNodeResolver.findDecompiled(ClassNodeResolver.java:251)
at org.codehaus.groovy.control.ClassNodeResolver.tryAsLoaderClassOrScript(ClassNodeResolver.java:189)
at org.codehaus.groovy.control.ClassNodeResolver.findClassNode(ClassNodeResolver.java:169)
at org.codehaus.groovy.control.ClassNodeResolver.resolveName(ClassNodeResolver.java:125)
1 error
* 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
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.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 2s
Command failed with exit code 1: C:\Users\Samsung PC\Desktop\user\platforms\android\gradlew :app:bundleRelease -b C:\Users\Samsung PC\Desktop\user\pl
atforms\android\build.gradle
[ERROR] An error occurred while running subprocess cordova.
cordova build android --release exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.

Problem with Gradle versions and Android Emulator

I'm new to using React and have been following along in a tutorial for a project to learn. Occasionally, I encounter an error that stops my progress, then I search the error, and I generally find some solution. But in this case, I am having a hell of a time. Part of the issue is that I am so new to developing software that I sometimes am unsure of how to implement someone's solution. And, in particular, this issue seems like it is not simply contained to a single project, which means that new projects I create with React are now also experiencing similar issues.
Here's the issue. When I use npm run android, I get the following output:
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1940 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Launching emulator...
error Failed to launch emulator. Reason: Could not start emulator within 30 seconds..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
> Configure project :react-native-reanimated
> No AAR for react-native-reanimated found. Attempting to build from source.
> Native libs debug enabled: false
> Android gradle plugin: 4.2.2
> Gradle: 7.2
> building Reanimated2
> Task :app:generatePackageList FAILED
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
10 actionable tasks: 3 executed, 7 up-to-date
FAILURE: Build failed with an exception.
* Where:
Script 'C:\\Users\\Astuertz\\Dev\\Values2\\node_modules#react-native-community\\cli-platform-android\\native_modules.gradle' line: 122
* What went wrong:
Execution failed for task ':app:generatePackageList'.
> argument type mismatch
* 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 8s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* Where:
Script 'C:\\Users\\Astuertz\\Dev\\Values2\\node_modules#react-native-community\\cli-platform-android\\native_modules.gradle' line: 122
* What went wrong:
Execution failed for task ':app:generatePackageList'.
> argument type mismatch
* 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 8s
at checkExecSyncError (node:child_process:828:11)
at execFileSync (node:child_process:866:15)
at runOnAllDevices (C:\Users\Astuertz\Dev\Values2\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at async Command.handleAction (C:\Users\Astuertz\Dev\Values2\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:182:9)
Someone had said that Gradle version 7 is incompatible with the current version of React and that it needs to be downgrade to version 7. I tried changing the version in the wrapper file for the Android folder, as well as taking someone's suggestion to change it in the Android Studio "Project Structure." In either case, the error either persisted or merely gave me a different error. What is going on here?
I've been trying to get my apps to run and compile but am in over my head.

React Native: Install to virtual/physical device failed

I'm currently using React Native to code my final year project. I have an issue when build and install it to virtual/physical devices althought a month ago it worked fine. Can someone explain to me wwhat wrongs with my code or files? Does it get corrupted? Because I tried to created a blank new file I still get the same errors.
My error:
> Task :app:processDebugResources 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.2/userguide/command_line_interface.html#sec:command_line_warnings
183 actionable tasks: 2 executed, 181 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
C:\Users\minht\SmartRoom\node_modules\react-native-image-crop-picker\android\build\intermediates\library_manifest\debug\AndroidManifest.xml:10:5-14:15: AAPT: error: unexpected element <queries> found in <manifest>.
* 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 11s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Seems like you need upgrade Gradle from Android studio and then try if you can run your project from Android Studio.

React-native android studio Build Failed

When I do build->rebuild project the build fails in the android studio. I have the error message posted below. This is very strange because I didn't change anything, all I tried was to create a new AVD and the next thing you know trying to build it causes an error. Now I can't get it to run. I am hesitant to try some random quick fix because everything was working fine until I created a new AVD.
> Task :app:compileDebugJavaWithJavac FAILED
/Users/waltershub/Desktop/Fluz-Develop/fluzfluz-frontend/fluzclient/android/app/src/main/java/com/fluzclient/MainApplication.java:22: error: cannot find symbol
import io.branch.referral.Branch;
^
symbol: class Branch
location: package io.branch.referral
/Users/waltershub/Desktop/Fluz-Develop/fluzfluz-frontend/fluzclient/android/app/src/main/java/com/fluzclient/MainApplication.java:98: error: cannot find symbol
Branch.getAutoInstance(this);
^
symbol: variable Branch
location: class MainApplication
Note: /Users/waltershub/Desktop/Fluz-Develop/fluzfluz-frontend/fluzclient/android/app/src/main/java/com/fluzclient/MainActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.0-milestone-1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 19s
409 actionable tasks: 381 executed, 28 up-to-date
Branch SDK is not properly imported in your React project.
https://docs.branch.io/pages/apps/react-native/
Follow YARN installation to add dependencies in the project.

Categories

Resources