Execution failed for task ':packageDebug' - ionic framework - android

It was working properly.. But suddenly when I tried to run ionic build android, I got this error. I am not able to find out the issue.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':packageDebug'.
> Failed to add C:\git\personal\amarEla-app\platforms\android\build\intermediate
s\exploded-aar\android\CordovaLib\unspecified\debug\classes.jar
* 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: 6.603 secs
c:\git\personal\amarEla-app\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "c:\git\personal\amarEla-app\plat
forms\android\gradlew cdvBuildDebug -b c:\git\personal\amarEla-app\platforms\and
roid\build.gradle -Dorg.gradle.daemon=true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 8
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 8
at ChildProcess.whenDone (c:\Users\amitsinha02\AppData\Roaming\npm\node_modu
les\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:134:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)
Any suggestions?

Related

npx expo run:android not wokring on m1 mac

So I have ejected an expo app to a normal react native app. The IOS version of the app is working fine. But I can't seem to start the android version.
I am getting this error log:
› Skipping dev server
› Building app...
Configuration on demand is an incubating feature.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':react-native-gradle-plugin'.
> Could not create service of type OutputFilesRepository using ExecutionGradleServices.createOutputFilesRepository().
> Failed to create parent directory '/Users/moemenhussein/Documents/Projects/ahmo/restart-lifestyle/restart-lifestyle/node_modules/react-native-gradle-plugin/.gradle' when creating directory '/Users/moemenhussein/Documents/Projects/ahmo/restart-lifestyle/restart-lifestyle/node_modules/react-native-gradle-plugin/.gradle/buildOutputCleanup'
* 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 2s
Error: /Users/moemenhussein/Documents/Projects/ahmo/restart-lifestyle/restart-lifestyle/android/gradlew exited with non-zero code: 1
Error: /Users/moemenhussein/Documents/Projects/ahmo/restart-lifestyle/restart-lifestyle/android/gradlew exited with non-zero code: 1
at ChildProcess.completionListener (/Users/moemenhussein/Documents/Projects/ahmo/restart-lifestyle/restart-lifestyle/node_modules/#expo/spawn-async/build/spawnAsync.js:52:23)
at Object.onceWrapper (node:events:642:26)
at ChildProcess.emit (node:events:527:28)
at maybeClose (node:internal/child_process:1092:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
...
at Object.spawnAsync [as default] (/Users/moemenhussein/Documents/Projects/ahmo/restart-lifestyle/restart-lifestyle/node_modules/#expo/spawn-async/build/spawnAsync.js:17:21)
at spawnGradleAsync (/Users/moemenhussein/Documents/Projects/ahmo/restart-lifestyle/restart-lifestyle/node_modules/#expo/cli/build/src/start/platforms/android/gradle.js:72:46)
at Object.assembleAsync (/Users/moemenhussein/Documents/Projects/ahmo/restart-lifestyle/restart-lifestyle/node_modules/#expo/cli/build/src/start/platforms/android/gradle.js:52:18)
at runAndroidAsync (/Users/moemenhussein/Documents/Projects/ahmo/restart-lifestyle/restart-lifestyle/node_modules/#expo/cli/build/src/run/android/runAndroidAsync.js:31:24)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
I have already removed my package-lock.json, node_module etc. I really do not know what to do.

React Native android emulator doesn't working

`> helloworld#1.0.0 android
expo run:android
› Opening emulator Pixel_4_XL
› Building app...
Picked up _JAVA_OPTIONS: -Xmx512M
Configuration on demand is an incubating feature.
FAILURE: Build failed with an exception.
Where:
Settings file 'C:\Users\oktay\OneDrive\Masa³st³\React-Native\HelloWorld\android\settings.gradle' line: 3
What went wrong:
A problem occurred evaluating settings 'HelloWorld'.
Could not read script 'C:\Users\oktay\OneDrive\Masa├â•st├â•\React-Native\HelloWorld\node_modules\expo\scripts\autolinking.gradle' as it does not exist.
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 2s
Error: C:\Users\oktay\OneDrive\Masaüstü\React-Native\HelloWorld\android\gradlew.bat exited with non-zero code: 1
Error: C:\Users\oktay\OneDrive\Masaüstü\React-Native\HelloWorld\android\gradlew.bat exited with non-zero code: 1
at ChildProcess.completionListener (C:\Users\oktay\OneDrive\Masaüstü\React-Native\HelloWorld\node_modules\#expo\spawn-async\build\spawnAsync.js:52:23)
at Object.onceWrapper (node:events:628:26)
at ChildProcess.emit (node:events:513:28)
at ChildProcess.cp.emit (C:\Users\oktay\OneDrive\Masaüstü\React-Native\HelloWorld\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (node:internal/child_process:1100:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
...
at Object.spawnAsync [as default] (C:\Users\oktay\OneDrive\Masaüstü\React-Native\HelloWorld\node_modules\#expo\spawn-async\build\spawnAsync.js:17:21)
at spawnGradleAsync (C:\Users\oktay\OneDrive\Masaüstü\React-Native\HelloWorld\node_modules\#expo\cli\build\src\start\platforms\android\gradle.js:72:46)
at Object.assembleAsync (C:\Users\oktay\OneDrive\Masaüstü\React-Native\HelloWorld\node_modules\#expo\cli\build\src\start\platforms\android\gradle.js:52:18)
at runAndroidAsync (C:\Users\oktay\OneDrive\Masaüstü\React-Native\HelloWorld\node_modules\#expo\cli\build\src\run\android\runAndroidAsync.js:31:24)
at processTicksAndRejections (node:internal/process/task_queues:96:5)`
I'm running it, but the android emulator is causing problems. I am using mobile phone this post sorry for mistakes.

Cordova/Phonegap: get error when build a project

I am trying to build a android project using Phonegap. But i got this error
C:\Users\ss\Documents\Phonegap\hello1>cordova build
Running command: cmd "/s /c "C:\Users\ss\Documents\Phonegap\hello1\platforms\and
roid\cordova\build.bat""
ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_20
Running: C:\Users\ss\Documents\Phonegap\hello1\platforms\android\gradlew cdvBuil
dDebug -b C:\Users\ss\Documents\Phonegap\hello1\platforms\android\build.gradle -
Dorg.gradle.daemon=true
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\ss\Documents\Phonegap\hello1\platforms\android\build.gradle
' line: 22
* What went wrong:
A problem occurred evaluating root project 'android'.
> Failed to apply plugin [id 'android']
> Could not create plugin of type 'AppPlugin'.
* 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: 1.708 secs
C:\Users\ss\Documents\Phonegap\hello1\platforms\android\cordova\node_modules\q\q
.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "C:\Users\ss\Documents\Phonegap\h
ello1\platforms\android\gradlew cdvBuildDebug -b C:\Users\ss\Documents\Phonegap\
hello1\platforms\android\build.gradle -Dorg.gradle.daemon=true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 8
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 8
at ChildProcess.whenDone (C:\Users\ss\AppData\Roaming\npm\node_modules\cordo
va\node_modules\cordova-lib\src\cordova\superspawn.js:134:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
i am using 'cordova build' command to build android project.
please help what i missing? what should i do?

Cordova Android Build Exception

I am getting this error when trying to build a project created using Cordova CLI. I have added the android platform to the project.
D:\MHIS_Phonegap\MHIS>cordova build --info android
Running command: cmd "/s /c "D:\MHIS_Phonegap\MHIS\platforms\android\cordova\build.bat""
ANDROID_HOME=E:\adt-bundle-windows-x86_64-20130522\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_21
Running: D:\MHIS_Phonegap\MHIS\platforms\android\gradlew cdvBuildDebug -b D:\MHIS_Phonegap\MHIS\platforms\android\build.gradle -Dorg.gradle.daemon=true
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:1.0.0+.
Required by:
:android:unspecified
> Failed to list versions for com.android.tools.build:gradle.
> Unable to load Maven meta-data from https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml.
> Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml'.
> peer not authenticated
* 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: 11.562 secs
D:\MHIS_Phonegap\MHIS\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "D:\MHIS_Phonegap\MHIS\platforms\android\gradlew cdvBuildDebug -b D:\MHIS_Phonegap\MHIS\platforms\android\build.gradle -Dorg.gradle.daemon=true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 1
at ChildProcess.whenDone (C:\Users\lenovo\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:134:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
Any help on what is the cause and how to resolve?

CCA Emulate Android error

I'm making an android app in the Chrome API. I got my emulator set up and everything seems to be working fine except CCA throws a weird error.
C:\Users\Giovanni\Google Drive\cde\dwm\DerpyWorld>cca emulate android
cca v0.5.0
Running command: "C:\Program Files\nodejs\node.exe" "C:\Users\Giovanni\Google Drive\cde\dwm\DerpyWorld\hooks\before_prep are\cca-check.js" "C:\Users\Giovanni\Google Drive\cde\dwm\DerpyWorld"
Running command: cmd "/s /c ""C:\Users\Giovanni\Google Drive\cde\dwm\DerpyWorld\platforms\android\cordova\run.bat" --emulator""
'C:\Users\Giovanni\Google' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Giovanni\Google Drive\cde\dwm\DerpyWorld\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s,/c,C:\Users\Giovanni\Google Drive\cde\dwm\DerpyWorld\platforms\android\gradl
ew,assembleX86Debug,-b,C:\Users\Giovanni\Google Drive\cde\dwm\DerpyWorld\platforms\android\build.gradle,-Dorg.gradle.dae
mon=true,-x,lint,-x,lintVitalX86Release,-x,lintVitalArmv7Release,-x,compileLint,-x,copyReleaseLint,-x,copyDebugLint
Error: cmd: Command failed with exit code 8
at ChildProcess.whenDone (C:\Users\Giovanni\AppData\Roaming\npm\node_modules\cca\node_modules\cordova\node_modules\c
ordova-lib\src\cordova\superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
C:\Users\Giovanni\Google Drive\cde\dwm\DerpyWorld>
Any ideas?
Oke, well I fixed the last issue by moving it into a folder with no spaces... a really bad fix imo. Of course, issues continue.
C:\Users\Giovanni\android\DerpyWorld>cca emulate android
cca v0.5.0
Running command: "C:\Program Files\nodejs\node.exe" C:\Users\Giovanni\android\DerpyWorld\hooks\before_prepare\cca-check.js C:\Users\Giovanni\android\DerpyWorld
Running command: C:\Users\Giovanni\android\DerpyWorld\platforms\android\cordova\run.bat --emulator
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\Giovanni\android\DerpyWorld\platforms\android\build.gradle' line: 27
What went wrong:
A problem occurred evaluating root project 'android'.
Failed to apply plugin [id 'android']
Gradle version 1.10 is required. Current version is 2.2.1. If using the gradle wrapper, try editing the distributionUrl in C:\Users\Giovanni\android\DerpyWorld\gradle\wrapper\gradle-wrapper.properties to gradle-1.10-all.zip
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: 1.178 secs
C:\Users\Giovanni\android\DerpyWorld\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s,/c,C:\Users\Giovanni\android\DerpyWorld\platforms\android\gradlew,assembleX86Debug,-b,C:\Users\Giovanni\android\DerpyWorld\platforms\android\build.gradle,-Dorg.gradle.daemon=true,-x,lint,-x,lintVitalX86Release,-x,lintVitalArmv7
Release,-x,compileLint,-x,copyReleaseLint,-x,copyDebugLint
Error: C:\Users\Giovanni\android\DerpyWorld\platforms\android\cordova\run.bat: Command failed with exit code 8
at ChildProcess.whenDone (C:\Users\Giovanni\AppData\Roaming\npm\node_modules\cca\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
C:\Users\Giovanni\android\DerpyWorld>C:\Users\Giovanni\android\DerpyWorld\gradle\wrapper\gradle-wrapper.properties to gradle-1.10-all.zip
The problem is with this line:
cmd "/s /c ""C:\Users\Giovanni\Google Drive\cde\dwm\DerpyWorld\platforms\android\cordova\run.bat" --emulator""
The path is not passed properly as a parameter, and the parse is not reading past the in the path.
There is a setting somewhere in CCA that determines the value of this line, and it is incorrect. You need to double-check your ""s in that string, as they are causing your error.

Categories

Resources