React Native: Install to virtual/physical device failed - android

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.

Related

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.

How do I build Ionic cordova for android?

I am new to Ionic and I want to emulate Ionic in an Android platform rather than to run it in a browser. But I am stuck with this error during "ionic cordova build android" using VS CODE.
Please find the following details:
> cordova.cmd requirements android
Requirements check results for android:
Java JDK: installed 18.0.1
Android SDK: installed true
Android target: installed android-33,android-30
Gradle: installed C:\Gradle\gradle-7.4.2\bin\gradle.BAT
Actual Error:
> 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 #5cb1c671
* 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.4.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 7s
17 actionable tasks: 17 executed
Command failed with exit code 1: E:\Ionic\Projects\NirogalayaFoundation\platforms\android\gradlew cdvBuildDebug -b E:\Ionic\Projects\NirogalayaFoundation\platforms\android\build.gradle
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
Please help me out.

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.

Problems when building in ionic cordova

Hello, I use Ionic for my app. I can serve it but cant built. Here this problem:
Please, help me if you can
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileReleaseJavaWithJavac'.
> 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 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 30s
47 actionable tasks: 8 executed, 39 up-to-date
Command failed with exit code 1: C:\Users\Darkhan\Downloads\GrandTovarPlus\pvl\platforms\android\gradlew :app:bundleRelease -b C:\Users\Darkhan\Downloads\GrandTovarPlus\pvl\platforms\android\build.gradle
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android --release exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.

ReactNative error: Execution failed for task ':react-native-reanimated:checkDebugManifest'

I started to work on a react native project. But I have a problem now. I built a simple project and execute react-native run-android. But error occurred.
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 954 file(s) to forward-jetify. Using 6 workers...
info Starting JS server...
info Installing the app...
> Task :app:createDebugCompatibleScreenManifests FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings
40 actionable tasks: 12 executed, 28 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:createDebugCompatibleScreenManifests'.
> Failed to create directory 'E:\web_project\fcManager\app\svn_prj\02_source\fcmanager\android\app\build\intermediates\compatible_screen_manifest\debug\createDebugCompatibleScreenManifests\out'
* 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 7s
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.
* What went wrong:
Execution failed for task ':app:createDebugCompatibleScreenManifests'.
> Failed to create directory 'E:\web_project\fcManager\app\svn_prj\02_source\fcmanager\android\app\build\intermediates\compatible_screen_manifest\debug\createDebugCompatibleScreenManifests\out'
* 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
And then I cleared the cache by yarn start --reset-cache, and execute again react-native run-android. Error again. But the latter errors are different from the former errors.
What could be a problem?
Wow. I solve the problem.
>cd android
android>./gradlew clean
And then apk is successfully installed on the emulator.

Categories

Resources