Cordova returning following error on build
cordova build
Please find the attached log below
Total time: 2.77 secs
/home/user/Softwares/phonegap/hello/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /home/user/Softwares/phonegap/hello/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/user/Softwares/phonegap/hello/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /home/user/Softwares/phonegap/hello/platforms/android/cordova/build: Command failed with exit code 8
You may not have the required environment or OS to build this project
Error: /home/user/Softwares/phonegap/hello/platforms/android/cordova/build: Command failed with exit code 8
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
user#user-Inspiron-1525:~/Softwares/phonegap/hello$ vi ~/.profile
user#user-Inspiron-1525:~/Softwares/phonegap/hello$ which android
/usr/local/android-sdk-linux/tools/android
user#user-Inspiron-1525:~/Softwares/phonegap/hello$ ls -ltr /usr/local/android-sdk-linux/tools/android
-rwxrwxrwx 1 144773 5000 3498 Jun 18 08:12 /usr/local/android-sdk-linux/tools/android
The environmental variables are below
export ANDROID_HOME="/usr/local/android-sdk-linux"
export ANDROID_PLATFORM_TOOLS="/usr/local/android-sdk-linux/platform-tools"
export PATH="$PATH:$ANDROID_HOME:$ANDROID_PLATFORM_TOOLS"
i could create a project using cordova. But, while doing cordova build am getting the error.
Please help to resolve the same ..
I have been building my phonegap app in node.js without any problem. Suddenly when I tried to build now, it is showing some error and apk is not getting created.
Here is the error :
C:\testapp\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "ant debug -f C:\testapp\platform
s\android\build.xml -Dout.dir=ant-build -Dgen.absolute.dir=ant-gen"
ERROR building one of the platforms: Error: C:\testapp\platforms\android\cordova
\build.bat: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: C:\testapp\platforms\android\cordova\build.bat: Command failed with exit
code 1
at ChildProcess.whenDone (C:\Users\Vaishakh\AppData\Roaming\npm\node_modules
\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:131:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1008:16)
at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
I haven't tweaked any system settings/properties. I haven't changed or uninstalled anything. This happened suddenly. I tried restarting but it didn't work.
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.
I have tried to create the cordova latest application using command line interface. When I tried to build the application using CLI, the following error occurs:
-pre-compile:<
BUILD FAILED
C:\Users\user\Desktop\HelloAndroid\platforms\android\custom_rules.xml:5: Reference project.all.jars.path not found.
Total time: 2 seconds
Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,C:\Users\user\Desktop\HelloAndroid\platforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: C:\Users\user\Desktop\HelloAndroid\platforms\android\cordova\build.bat: Command failed with exit code 2
at ChildProcess.whenDone (C:\Users\user\AppData\Roaming\npm\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\user\Desktop\HelloAndroid>
i'm building an android app with about 4Gig of local files ( most of them are songs ).
When i build my application for android using "cordova build android" command, i get the following error:
Compiling app on platform "android" via command
/Users/yveswebit/Desktop/APP/platforms/android/cordova/build
/usr/local/lib/node_modules/cordova/node_modules/q/q.js:126
throw e;
^
Error: An error occurred while building the android project.Error executing "ant debug -f "/Users/yveswebit/Desktop/APP/platforms/android/build.xml"":
BUILD FAILED
/Development/adt-bundle/sdk/tools/ant/build.xml:932: The following error occurred while executing this line:
/Development/adt-bundle/sdk/tools/ant/build.xml:950: null returned: 1
Total time: 23 seconds
at ChildProcess.<anonymous> (/usr/local/lib/node_modules/cordova/src/compile.js:65:22)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Process.ChildProcess._handle.onexit (child_process.js:802:5)
When i'm builing my application with less songs, the build is succesfully.
Thanks for help