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?
Related
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?
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)
This is my first experience in cordova. I created the helloworld project and installed the android platform correctly. When I tried to build the project by cordova build android, it shows this error message.
Running command: /home/menaka/hello/platforms/android/cordova/build
[Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.]
ERROR building one of the platforms: Error: /home/menaka/hello/platforms/android/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /home/menaka/hello/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131: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)
But I have successfully set the ANDROID_HOME variable and PATH.
menaka#menaka-X550LC:~/hello$ echo $ANDROID_HOME
/Extra/Softwares/Android/Sdk/
So, what would be the reason for this?
I installed Cordova 4.2.0 and tried to launch my cordovaApp on android emulator.
I got this error message:
Failed to launch app on emulator: Failed to install apk to emulator: Error executing "adb -s
emulator-5556 install -r "C:\xampp\htdocs\CordovaApp\platforms\android\ant-build\CordovaApp-
debug.apk"": failed to copy 'C:\xampp\htdocs\CordovaApp\platforms\android\ant-build\CordovaApp-
debug.apk' to '/data/local/tmp/CordovaApp-debug.apk': No such file or directory
Command finished with error code 8: C:\xampp\htdocs\CordovaApp\platforms\android\cordova\run.bat
--emulator
Error: C:\xampp\htdocs\CordovaApp\platforms\android\cordova\run.bat: Command failed with exit
code 8
at ChildProcess.whenDone
(C:\Users\windows8new\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:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)
C:\xampp\htdocs\CordovaApp\nbproject\build.xml:275: exec returned: 1
I'm new in this so I don't know what to do. Can somebody help me?
Thank you very much.
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;