Error in building android app using Phonegap - javascript

For some reason, my android phonegap build fails every time I try to run it.I can’t seem to figure out what the problem is.
I am using the latest version of Cordova (5.3.3) and downloaded the correct SDK for android using Android studio (I think).
Any ideas what I’m doing wrong?
Here are my CLI logs:
FAILURE:
Build failed with an exception.
* What went wrong:
Execution failed for task ':prepareDebugDependencies'.
>
javax.xml.xpath.XPathExpressionException: org.xml.sax.SAXParseException; lineNumber: 41; columnNumber: 94; The prefix "tools" for attribute "tools:overrideLibrary" associated with an element type "uses-sdk" is not bound.
* Try:
Run with --stacktrace
option to get the stack trace. Run with --info
or
--debug
option to get more log output.
BUILD FAILED
Total time: 4.325 secs
/Users/macuser/Desktop/bacon copy/bacontest/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /Users/macuser/Desktop/bacon copy/bacontest/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/macuser/Desktop/bacon copy/bacontest/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /Users/macuser/Desktop/bacon copy/bacontest/platforms/android/cordova/build: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: /Users/macuser/Desktop/bacon copy/bacontest/platforms/android/cordova/build: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:139:23)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:817:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:
5)

Related

Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception

How can i fix this issue in my code? does anyone can help me how can I fix this error I am using latest version of react native I installed the project yesterday only but still its giving me this error came after i installed a package called "react-native-vision-camera" you can check that here https://mrousavy.com/react-native-vision-camera/docs/guides/ i followed every step but still this error came.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
The Android Gradle plugin supports only kotlin-android-extensions Gradle plugin version 1.6.20 and higher.
The following dependencies do not satisfy the required version:
project ':react-native-vision-camera' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30
* 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.
BUILD FAILED in 36s

React Native Task :app:installDebug FAILED [duplicate]

This question already has answers here:
react-native :app:installDebug FAILED
(35 answers)
Closed 8 days ago.
i'm trying to create a new app with react native. i was using android studio emulator and now i installed genymotion. whatever when i started the app i encounted an error. react native version is 0.69.4.
> Task :app:installDebug FAILED
Skipping device 'Custom - 4.4.4' for 'app:debug': minSdkVersion [21] > deviceApiLevel [19]
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.3.3/userguide/command_line_interface.html#sec:command_line_warnings
147 actionable tasks: 2 executed, 145 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:installDebug'.
> java.util.concurrent.ExecutionException: org.gradle.api.GradleException: Failed to install on any devices.
* 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
BU?LD FAILED in 31s
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:installDebug'.
> java.util.concurrent.ExecutionException: org.gradle.api.GradleException: Failed to install on any devices.
* 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
BU?LD FAILED in 31s
at makeError (C:\Users\Egehan Berker\Desktop\poemtra\poemtra\node_modules\#react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at C:\Users\Egehan Berker\Desktop\poemtra\poemtra\node_modules\#react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (C:\Users\Egehan Berker\Desktop\poemtra\poemtra\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\Users\Egehan Berker\Desktop\poemtra\poemtra\node_modules\#react-native-community\cli\build\index.js:192:9)
min sdk version is 21 and compileSdkVersion is 31. what should i do?
The minSdkVersion of your app is API Level 21 ( Android 5.0 ). It caused an error because you are trying to install the app on a device with API Level 19 (Andriod 4.4.4)
You can try to lower your minSdkVersion to API Level 19 (Android 4.4.4) on android/build.gradle or install your app on the emulator Android > 5.0.

React native Webview error, App not installing Help me to solve this

I am creating an app that uses webview. I installed and imported the webview and when using it, app was not installed in the android emulator. Without webview app installing correctly.
I tried by creating another project for example ,same error returns.
Here is the error by using webview:
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file 'F:\FirstProject\node_modules\react-native-webview\android\build.gradle' line: 35
* What went wrong:
A problem occurred evaluating project ':react-native-webview'.
> org/jetbrains/kotlin/cli/common/PropertiesKt
* 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-webview'.
> 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 15s
I am using java version: java 15.0.2
compileSdkVersion : 30

Android apk Can not build with react-native-image-picker

This is the error while building apk react native 0.51
:app:processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Error: A library uses the same package as this project: com.imagepicker
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 4 mins 51.11 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
here image of error

Execution failed for task :processDebugResources [ react-native ]

I present the following error when running react-native run-android
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 15.042 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
Do you have any idea how to solve this problem?
Thanks!!

Categories