Error Build Failed-Cordova windows 8 - android

While trying to build a project I got this error
I was following this ,everything seemed fine till
"cordova build".
I've tried to downgrade node and many other solutions suggested in some similar questions but I've had no luck.
OS: Windows 8.1 x64
Cordova v 5.1.1
Ant version 1.9.4
Node v0.12.7
npm 2.11.3
Android sdk and Java are probably installed and added to Environment variables PATH
also sdk/tools and /platform-tools are also included in PATH
Error
C:\Users\user-\dua>cordova build
Running command: cmd "/s /c "C:\Users\user-\dua\platforms\android\cordova\build.
bat""
ANDROID_HOME=C:\android-sdk-win
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_51
Running: C:\Users\user-\dua\platforms\android\gradlew cdvBuildDebug -b C:\Users\
user-\dua\platforms\android\build.gradle -Dorg.gradle.daemon=true
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\user-\dua\platforms\android\build.gradle' line: 185
What went wrong:
A problem occurred evaluating root project 'android'.
Invalid revision: 23.0.0.3
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: 14.269 secs
C:\Users\user-\dua\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "C:\Users\user-\dua\platforms\and
roid\gradlew cdvBuildDebug -b C:\Users\user-\dua\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\user-\AppData\Roaming\npm\node_modules\co
rdova\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)

Related

Issues while building apk using android platforn in ubuntu 14.0.4

Good morning. I'm newer in ionic and face this issues since 3 day.
node -v: v5.8.0
npm -v: 3.7.3
cordova -v: 6.4.0
ionic -v: 2.2.1
java -version: openjdk version "1.8.0_45-internal"
OpenJDK Runtime Environment (build 1.8.0_45-internal-b14)
OpenJDK Server VM (build 25.45-b02, mixed mode)
when I try : >ionic build android
I have this issues
:CordovaLib:processDebugResources
~/android-sdk/build-tools/25.0.0/aapt: 3: /home/donvex/android-sdk/build-tools/25.0.0/aapt: Syntax error: Unterminated quoted string
FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':CordovaLib: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: 12.544 secs
Error: /opt/lampp/htdocs/www/pneupur_app//platforms/android/gradlew: Command failed with exit code 1 Error output:
~/android-sdk/build-tools/25.0.0/aapt: 3: ~/android-sdk/build-tools/25.0.0/aapt: Syntax error: Unterminated quoted string
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':CordovaLib: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.
Some body help me :worried:
Try installing 32bit dependencies
sudo apt-get install -y lib32gcc1 libc6-i386 lib32z1 lib32stdc++6

Cordova building error on Windows

I am having a tremendous problem with cordova. For some reason, the command cordova build gives me the following error and I cannot figure out why. I try to do a simple andoid application on Windows 7.
C:\Users\User\Documents\Cordova\workshop>cordova build
Running command: cmd "/s /c "C:\Users\User\Documents\Cordova\workshop\platforms\
android\cordova\build.bat""
[Error: Please install Android target: "android-22".
Hint: Open the SDK manager by running: C:\Users\User\AppData\Local\Android\sdk\t
ools\android.BAT
You will require:
1. "SDK Platform" for android-22
2. "Android SDK Platform-tools (latest)
3. "Android SDK Build-tools" (latest)]
ERROR building one of the platforms: Error: cmd: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 2
at ChildProcess.whenDone (C:\Users\User\AppData\Roaming\npm\node_modules\cor
dova\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:818:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
C:\Users\User\Documents\Cordova\workshop>
Do you have any advice how to solve this problem?

ionic build android error not creating the apk file

When I ran the following command:
ionic build android
in the command prompt on my Windows 7 machine I get the following errors pop up:
BUILD FAILED
C:\adt-bundle-windows-x86_64-20140702\sdk\tools\ant\build.xml:542: Unable to resolve project target 'android-21'
Total time: 1 second
C:\Users\<user name>\Hello_Android\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:\Users\<user name>\Hello_Android\platforms\android\build.xml" -Dout.dir=ant-build -Dgen.absolute.dir=ant-gen"
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 the project
Error: cmd: Command failed with exit code 1
at ChildProcess.whenDone <C:\Users\<user name>\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:1015:16>
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
Could anybody help me please with this problem?

cordova build error on ubuntu when trying to build from terminal

I am getting the following error when trying to build sencha app in terminal on ubuntu meachine..
edge#edge-HP:~/Desktop/Anupam2014/MobileAtSite_Aug23/cordova$ cordova build
Running command: /home/edge/Desktop/Anupam2014/MobileAtSite_Aug23/cordova/platforms/android/cordova/build
Buildfile: /home/edge/Desktop/Anupam2014/MobileAtSite_Aug23/cordova/platforms/android/build.xml
BUILD FAILED
/home/edge/Desktop/Anupam2014/MobileAtSite_Aug23/cordova/platforms/android/build.xml:90: Cannot find
/home/transnoesis/Downloads/adt-bundle-linux-x86_64-20130729/sdk/tools/ant/build.xml imported from
/home/edge/Desktop/Anupam2014/MobileAtSite_Aug23/cordova/platforms/android/build.xml
Total time: 0 seconds
Error code 1 for command: ant with args: debug,-
f,/home/edge/Desktop/Anupam2014/MobileAtSite_Aug23/cordova/platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: /home/edge/Desktop/Anupam2014/MobileAtSite_Aug23/cordova/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/lib/node_modules/cordova/src/superspawn.js:126: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)
This looks path settings issue and is unable to find path to sdk & ant tools.
Currently I am on Windows and see how I've set paths on Windows, so you check and set yours accordingly on Ubuntu, hope will help you.
ANT_Home: C:\Program Files\apache-ant-1.9.4
Java_Home: C:\Program Files\Java\jdk1.7.0_60
ANDROID_HOME: C:\Android\AndroidSDK\sdk
path:.;C:\Program Files\nodejs\;%ANT_HOME%\bin;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools;

Google Chrome App while running on android emulator giving error

I'm trying to run a simple Hello chrome app on android emulator. After navigating to the app directory when I run
cca emulate android
After some time I get an error:
Here is the full cmd line response:
cca v0.4.1
Running command: /home/jay/HelloChromeAppOnAndroid/platforms/android/cordova/run --emulator
WARNING : no emulator specified, defaulting to myAvd
Waiting for emulator...
emulator: emulator window was out of view and was recentered
Booting up emulator (this may take a while).......................BOOT COMPLETE
FAILURE: Build failed with an exception.
* Where:
Build file '/home/jay/HelloChromeAppOnAndroid/platforms/android/build.gradle' line: 175
* What went wrong:
A problem occurred evaluating root project 'android'.
> No match found
* 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: 3.074 secs
/home/jay/HelloChromeAppOnAndroid/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /home/jay/HelloChromeAppOnAndroid/platforms/android/gradlew with args: assembleArmv7Debug,-b,/home/jay/HelloChromeAppOnAndroid/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-x,lint,-x,lintVitalX86Release,-x,lintVitalArmv7Release,-x,compileLint,-x,copyReleaseLint,-x,copyDebugLint
Error: /home/jay/HelloChromeAppOnAndroid/platforms/android/cordova/run: Command failed with exit code 8
at ChildProcess.whenDone (/home/jay/.nvm/v0.10.32/lib/node_modules/cca/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)
Seem's like the problem has been fixed. I had posted an issue in GitHub and it's resolved now.
All you got to do is
npm install -g cca
to update the toolchain.

Categories

Resources