Command failed with exit code ENOENT in visual studio 2013 - android

Hi i am getting this error while trying to build my application in visual studio 2013 community version
1>------ Build started: Project: BlankCordovaApp2, Configuration: Debug Android ------
1>Build started 12/1/2014 4:12:42 PM.
1>TrackJsChanges:
1> GeneratedJavascript=scripts\index.js;scripts\index.js.map;scripts\platformOverrides.js;scripts\platformOverrides.js.map
1>InstallMDATargets:
1> D:\VBWORKSPACE\BlankCordovaApp2\BlankCordovaApp2>call "C:\Program Files (x86)\nodejs\"\nodevars.bat
1> Your environment has been set up for using Node.js 0.10.33 (ia32) and npm.
1> ------ Ensuring correct global installation of package from source package directory: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\COMMON7\IDE\EXTENSIONS\DOFNNIMZ.R4T\packages\vs-mda
1>MDAVSCLI : error : C:\Users\sourav.phukon\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\create: Command failed with exit code ENOENT
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:11.87
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
Please suggest how can i resolved this issue.....

I got the solution ....
just go to Go to Tools --> Options --> Tools for Apache Cordova --> Cordova Tools --> Clear Cordova Cache and it works fine..
when i tried for first time i got another different error during bulid as
MDAVSCLI : error : Cannot find module 'q' error
if you got this error open cmd prompt and try this cmd
npm install ripple -g
Try to clean cordava again and create a new project now its works fine for me...

Related

Ionic2 - Android build failed

I was trying to build an Ionic2 app with Android platform on my Win 7 (32 bt) system.
I ran the ionic build android command in the CLI and the following error occurred :
...ionic build android
> ionic-hello-world# ionic:build D:\<path>
> ionic-app-scripts build
[20:12:32] ionic-app-scripts 1.0.0
[20:12:32] build dev started ...
[20:12:32] clean started ...
[20:12:32] clean finished in 10 ms
[20:12:32] copy started ...
[20:12:32] transpile started ...
[20:12:37] transpile finished in 5.47 s
[20:12:37] webpack started ...
[20:12:38] copy finished in 5.74 s
[20:12:49] webpack finished in 11.84 s
[20:12:49] sass started ...
[20:12:52] sass finished in 2.81 s
[20:12:52] build dev finished in 20.16 s
[20:12:58] tslint: D:/../src/app/app.component.ts, line: 3
Unused import: 'OneSignal'
L2: import { Platform } from 'ionic-angular';
L3: import { StatusBar, Splashscreen, OneSignal } from 'ionic-native';
ANDROID_HOME=C:\Users\<user-name>\AppData\Local\Android\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_60
Subproject Path: CordovaLib
Starting a new Gradle Daemon for this build (subsequent builds will be faster).
FAILURE: Build failed with an exception.
* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
Then as suggested I read the 'https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html' and created the gradle.properties file with the following
org.gradle.daemon=true
The error still persists with the same result !!!
What is going wrong ?? Please help .
Found the solution after a hour long R&D.
Basically as per 'https://cordova.apache.org/docs/en/latest/guide/platforms/android/' - As of cordova-android#4.0.0, Cordova for Android projects are built using Gradle. Earlier it was built using Apache Ant.
Now Gradle looks for latest Android SDK. When I removed the android platform and added again with ionic platform add android command - the CLI listed that the latest Android SDK ( in my case it was SDK 24 ) was not installed.
I installed the required SDK version using Android SDK Manager and subsequent add of Android Platform along with the cordova plugin smoothly installed without any error.
The CLI printed the following -
..ionic plugin add onesignal-cordova-plugin
Fetching plugin "onesignal-cordova-plugin" via npm
Installing "onesignal-cordova-plugin" for android
ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121
Subproject Path: CordovaLib
Incremental java compilation is an incubating feature.
:clean
:CordovaLib:clean
BUILD SUCCESSFUL
Total time: 1.611 secs
Subproject Path: CordovaLib
Try using cordova platform add https://github.com/apache/cordova-android
Ive had to start using this command ever since updating Ionic.

debug Android app using Visual Studio 2015 Cordova on a VMware and have debug.keystore not found error

The build is OK until it's asking for a debug key. Here is part of the output log:
[apkbuilder] Creating MainActivity-debug-unaligned.apk and signing it with a debug key...
1>MDAVSCLI : [apkbuilder] keytool error : java.io.FileNotFoundException: \\vmware-host\Shared Folders\.android\debug.keystore (The system cannot find the path specified)
1> [apkbuilder] Picked up _JAVA_OPTIONS: -Xmx512M
1> Command finished with error code 1: C:\FirstApp\FirstApp\platforms\android\cordova\build.bat --debug
1>ERROR building one of the platforms : error : C:\FirstApp\FirstApp\platforms\android\cordova\build.bat: Command failed with exit code 1
1> You may not have the required environment or OS to build this project
1>MDAVSCLI : error : C:\FirstApp\FirstApp\platforms\android\cordova\build.bat: Command failed with exit code 1
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
I'm running a Windows 8.1 on mac Yosemite using VMware. Seems like it's trying to look for the debug key in share folder and couldn't find it. I'm clueless how I can fix this problem.
I've checked the environment variables, ADT_HOME, ANT_HOME, GIT_HOME, JAVA_HOME and they all point to the correct locations.
%JAVA_HOME%\bin is also added to the system environment PATH.
I figured it out. The problem is that I can't create folder under \vmware-host\Shared Folders. This also gave me hard time when running Android SDK Manager to fetch Android repository because the Manifest Cache directory points to \vmware-host\Shared Folders too.
The solution is to add a new environment variable.
Variable name: ANDROID_SDK_HOME
Variable value: C:\Users>User Name<
This is the post that helps a lot. Possible to change where Android Virtual Devices are saved?
Don't forget to restart the computer after the change.

How to solve this errors Ant, add platform android and cordova build android failure

Here is a PATH in environment :
C:\Users\user\AppData\Roaming\npm;D:\work\SDK\SoftPhonegap\ADT\sdk\platform-tools;D:\work\SDK\SoftPhonegap\ADT\sdk\tools;D:\work\SDK\SoftPhonegap\apache-ant-1.9.5\bin;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Java\jdk1.7.0_51\bin;C:\Program Files\Java\jdk1.8.0_45\bin;D:\work\SDK\SoftPhonegap\ADT\sdk\build-tools
A. Error log of cordova build android
BUILD FAILED
D:\work\SDK\SoftPhonegap\ADT\sdk\tools\ant\build.xml:601: The following error oc
curred while executing this line:
D:\work\SDK\SoftPhonegap\ADT\sdk\tools\ant\build.xml:542: Unable to resolve proj
ect target 'android-21'
Total time: 0 seconds
D:\work\SDK\SoftPhonegap\ADT\hello\platforms\android\cordova\node_modules\q\q.js
:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "ant debug -f D:\work\SDK\SoftPho
negap\ADT\hello\platforms\android\build.xml -Dout.dir=ant-build -Dgen.absolute.d
ir=ant-gen"
ERROR building one of the platforms: Error: D:\work\SDK\SoftPhonegap\ADT\hello\p
latforms\android\cordova\build.bat: Command failed with exit code 8
You may not have the required environment or OS to build this project
Error: D:\work\SDK\SoftPhonegap\ADT\hello\platforms\android\cordova\build.bat: C
ommand failed with exit code 8
at ChildProcess.whenDone (C:\Users\user\AppData\Roaming\npm\node_modules\cor
dova\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)
B Error log of Ant
C:\Users\user>ant
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre1.8.
0_45\lib\tools.jar
Buildfile: build.xml does not exist!
Build failed
C. when add platform android
D:\work\SDK\SoftPhonegap\ADT\hello>cordova platform add android
npm http GET https://registry.npmjs.org/cordova-android/3.7.2
npm http 304 https://registry.npmjs.org/cordova-android/3.7.2
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: com.example.hello
Name: HelloWorld
Android target: android-21
Copying template files...
Project successfully created.
Installing "com.phonegap.plugins.PushPlugin" for android
Installing "com.salesforce" for android
Installing "org.apache.cordova.device" for android
Could not run SalesforceMobileSDK plugin android pre-install script
You are running node v0.10.25
You need to be running node 0.12 or above
You won't be able to successfully run: cordova build
Running SalesforceMobileSDK plugin android post-install script
The "android" utility does not exist at D:\work\SDK\SoftPhonegap\ADT\sdk\tools;D
:\work\SDK\SoftPhonegap\ADT\sdk\platform-tools\tools\android.bat. Make sure you
've properly installed the Android SDK.
I think you need to give platform_tools pah also, you should post your error log,
anyway here is how my PATH looks like
C:\Users\amitabhs\AppData\Roaming\npm;F:\Softs\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\platform-tools;F:\Softs\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\tools;F:\Softs\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\platforms;C:\Program Files\Java\jdk1.8.0_45\bin;C:\Program Files\apache-ant-1.9.5\bin;
check if it helps
Compile your project in https://build.phonegap.com/
There you have no problems with OS and can compile for all OS.
I use then for IOS compilation.
Solution:
Uninstall node v0.10.25
install node 0.12 or above
remove platform android (cordova platform rm android)
add platform android (cordova platform add android)
build android (cordova build android)
Done

Unable to build Cordova project in Visual Studio

I'm using Visual Studio 2013 and the Cordova CTP 1.1. When I try to build the project, I get the following cryptic error (line breaks added for readability):
Error 22
The command ""C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\vs-cli"
prepare --platform Android --configuration Debug
--projectDir . --projectName "servermon"" exited with code 8.
C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda-targets\Microsoft.MDA.targets 115 5 servermon
I've tried the solutions from this question as well as this question, and this doesn't appear to solve the issue. My system path appears to have everything relevant in it:
C:\Program Files\Java\jdk1.7.0_60\bin
C:\Users\Nathan\AppData\Local\Android\android-sdk\tools
C:\Users\Nathan\AppData\Local\Android\android-sdk\platform-tools
C:\apache-ant-1.9.3\bin
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\
C:\Program Files (x86)\Windows Live\Shared
C:\Program Files\Microsoft\Web Platform Installer\
C:\Program Files (x86)\nodejs\
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\
I've also opened up the SDK manager and made sure to get the latest (Rev 19) build tools. The system has been restarted more than once and I'm still not able to build. Does anyone have any ideas on how to fix this build issue?
Edit: Here is a screenshot of my SDK Manager
Edit2: Here is the build output
1>------ Build started: Project: servermon, Configuration: Debug Android ------
1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\Microsoft.TypeScript.targets(90,5): warning : The TypeScript Compiler was given no files for compilation, so it will skip compiling.
1> Your environment has been set up for using Node.js 0.10.26 (ia32) and npm.
1> ------ Ensuring correct global installation of package from source package directory: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\al3uox1v.u2n\packages\vs-mda
1> ------ Build settings:
1> ------ buildCommand: prepare
1> ------ platform: Android
1> ------ cordovaPlatform: android
1> ------ configuration: Debug
1> ------ cordovaConfiguration: Debug
1> ------ projectName: servermon
1> ------ projectSourceDir: C:\Users\Nathan\Documents\CordovaTest\cordovatest\cordovatest
1> ------ App dir C:\Users\Nathan\Documents\CordovaTest\cordovatest\cordovatest\bld\Debug already exists
1> ------ Copying app files to www
1> ------ Done copying app files to www
1> ------ Copying res files
1> ------ Done copying res files
1> ------ Platform android already exists
1> ------ Certificate copy from C:\Users\Nathan\Documents\CordovaTest\cordovatest\cordovatest\res\cert\android to platforms\android
1> ------ Done copying certificate files to platforms\android
1>
1> C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\node_modules\q\q.js:126
1> throw e;
1> ^
1> CordovaError: The provided path "C:\Users\Nathan\Documents\CordovaTest\cordovatest\cordovatest\bld\Debug\platforms\android" is not an Android project.
1> at Object.android_parser (C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\node_modules\cordova\src\metadata\android_parser.js:37:15)
1> at C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\node_modules\cordova\src\prepare.js:51:23
1> at Array.map (native)
1> at Object.prepare (C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\node_modules\cordova\src\prepare.js:49:35)
1> at preparePlatform (C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\app.js:322:24)
1> at _fulfilled (C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\node_modules\q\q.js:787:54)
1> at self.promiseDispatch.done (C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\node_modules\q\q.js:816:30)
1> at Promise.promise.promiseDispatch (C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\node_modules\q\q.js:749:13)
1> at C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\node_modules\q\q.js:557:44
1> at flush (C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\node_modules\q\q.js:108:17)
1>C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda-targets\Microsoft.MDA.targets(115,5): error MSB3073: The command ""C:\Users\Nathan\AppData\Roaming\npm\node_modules\vs-mda\vs-cli" prepare --platform Android --configuration Debug --projectDir . --projectName "servermon"" exited with code 8.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
It seems the Android template that was downloaded by Cordova is "corrupted".
To fix this:
Try deleting the cached android platform in your user directory:
C:\users\<username>\.cordova\android\*
Then, clean and build the Solution in Visual Studio. Or to be really sure, delete the ‘bld’ directory inside the project folder.
This should force Cordova to re-download the Android template and fix the issue.
for me I just deleted the bld folder and eveerything has become right
Some time visual studio catch creates problem, clear the cache.
Choose Tools, Options, Tools for Apache Cordova, and then choose
Cordova Tools.
Choose Clear Cordova Cache.
Close and re-open your project.
Choose Build, Clean Solution.

Error building android platform with phonegap

I have phonegap 3.2.0-0.17.0 installed on Ubuntu 12.10.
For some reason, when I try to build the android platform to my local project on phonegap, I get the following error:
> phonegap local build android
[phonegap] adding the Android platform...
[error] An error occured during creation of android sub-project. Looks like your environment fully supports cordova-android development!
Creating Cordova project for the Android platform:
Path: platforms/android
Package: com.package.project_name
Name: project_name
Android target: android-17
Building cordova-3.2.0.jar
{ [Error: Command failed:
BUILD FAILED
/path/to/adt-bundle-linux-x86_64-20131030/sdk/tools/ant/build.xml:653: The following error occurred while executing this line:
/path/to/adt-bundle-linux-x86_64-20131030/sdk/tools/ant/build.xml:698: null returned: 127
Total time: 1 second
] killed: false, code: 1, signal: null }
Here my JAVA_HOME, ANT_HOME & PATH configuration for any suggestion:
export JAVA_HOME=/usr/lib/jvm/default-java
export ANT_HOME=/usr/local/apache-ant-1.9.2
export PATH=${PATH}:/path/to/adt-bundle-linux-x86_64-20131030/sdk/platform-tools:/path/to/adt-bundle-linux-x86_64-20131030/sdk/tools:${ANT_HOME}/bin
Can someone help me to solve this?
Thanks!

Categories

Resources