Error creating android subproject when using phonegap run android command - android

I installed nodejs and did the following:
npm install -g phonegap
phonegap create <app path>
cd <app path>
phonegap run android
when i execute the run android command, I get below error:
An error occurred during creation of android-sub project. The system cannot find the project specified.
not sure where this is coming from.
any clues.
Thanks

Had the same problems and a hard time finding a solution, however:
Make sure JAVA is installed
Set JAVA_HOME & PATH variables
Make sure ANT is installed
Set ANT_HOME & PATH variables
Make sure Android SDK is installed
Add PATH to sdk/tools
Add PATH to sdk/platform-tool
Run SDK manager to update & install SDK elements
Run AVD manager to create a default emulator image
Install NodeJS (with PATH)
Follow the usual tutorials
npm install -g cordova
cordova create hello com.sample.hello HelloWorld
cd hello
cordova platform add android
cordova build
now launch your Emulator
cordova emulate android (patience, take ages...)
or
cordova run android
much faster, just make sure you mobile device is connected, on, unlocked, usb debug is on, and drivers are installed
if you can't find one try: sdk\extras\google\usb_driver
npm install -g phonegap
phonegap create hello com.sample.hello HelloWorld
cd hello
phonegap platform add android (if not working use cordova command)
phonegap build android
now your launch Emulator
phonegap emulate android (patience, take ages...)
or
phonegap run android
much faster, just make sure you mobile device is connected, on, unlocked, usb debug is on, and drivers are installed
if you can't find one try: sdk\extras\google\usb_driver
I think the main difference between phonegap/cordova, is phonegap (which belong to Adobe) has the possibility to build in the cloud via https://build.phonegap.com/

Whitespace is not allowed i would say

Related

How to install ionic app in android device through terminal?

I am developing an ionic android app and it generates the output apk file inside
project->platforms->android->build->outputs
Then inorder to test the app, i am forced to manually copy the apk file to my device to install app on it. So is there any way by which i can directly install the apk in my device when i build the ionic project through terminal? In android studio, the app get installed on the device when we run the project. I am looking for same kind of methode with ionic.
I suppose you are running ionic build android.
You need to run the command ionic run android.
If your ANDROID_HOME path is correctly set, it will run in your connected device or if no device is connected, it will start your android emulator device.
You can also run this command ionic run android --device. If your ANDROID_HOME path is correctly set, it will run in your connected device as well.

What is correct way of setting up phonegap project?

I have setup phonegap for android on my machine.I have searched over net and come with two different solutions for starting android project in phonegap
(1) Using Command Line Tool for creating project
phonegap create myFirstApp
cd myFirstApp
and then importing project in eclipse
(2) Directly from eclipse IDE
Choose New > Android Project and then filling necessary information
Now question is which should I use, and which one is better for starting phonegap project for android?
There is obviously, no single answer. You can use any, whatever you are interested in. Also, you can write your entire code in the www folder and may not open Eclipse at all.
Personally, I connect my android phone with USB debugging on, and whenever I feel like testing my app, I type in the command in the terminal
$ cordova run android
If you have configured a Virtual Machine, it will start the virtual machine or the app is installed directly on my device.
The correct way is
3) Using Command Line Tool for creating project
phonegap create myFirstApp
cd myFirstApp
Use any editor to edit the www folder (brackets, sublime)
Use the CLI to run, build, etc.
Forget about eclipse.
According to the Documentation the best way is as follows:
$ cordova create hello com.example.hello HelloWorld
$ cd hello
Then to add platforms:
$ cordova platform add ios
$ cordova platform add amazon-fireos
$ cordova platform add android
$ cordova platform add blackberry10
$ cordova platform add firefoxos
And run the app
$ cordova emulate ios
And build the app
$ cordova build ios

phonegap remote build command "android" failed

I installed latest version of phonegap with npm, which shows version 4, and latest android sdk.
After creating simple myApp "hello world" project to test, I added android platform and can do local build and run the app with phonegap developer app on my phone.
But... if I do a remote phonegap build then the error log from build.phonegap.com for this app shows
'Error: The command "android" failed. Make sure you have the latest Android SDK installed, and the "android" command (inside the tools/ folder) is added to your path.'
I have JAVA_HOME and ANT_HOME configured and ant and the android sdk tools and platform-tools are in my path.
I can execute android from cmd shell to bring up SDK Manager.
This is all on Windows 7 64 bit.
I'm probably missing something simple, but driving me nuts that I can't do a remote build.
It appears that there was a temporary problem with the phonegap build service, which is now working again.
Ah well...

How do I install Phonegap 3.3 on Windows

I just went to Phonegap and saw that I needed to install node.js to get started.
I did this, then followed the command line to install phonegap.
However, where is it? I don't see anything in my program files folder, I don't see Eclipse, and there's no documentation on what to do next on Phonegap's website. I don't understand why this instruction is so vague? What am I missing? And where did all those files I downloaded/installed go go?
Thanks
Phonegap 3.3 installation there is no proper info in phonegap site.
The reason of installing nodejs is, phonegap cordova are created as node modules.
Required Software’s:
Follow the steps. 1 Node Js 2 ANT 3 Android_sdk 4 JDK
open command prompt:
Follow the steps
C:\user\youruser>npm install -g phonegap
C:\user\youruser>npm install -g cordova
Set Environment variables:
Mycomputer -> Right Click -> properties -> Advance System settings -> Environment
variables
set path for 1. Java JDK 2. Android SDK 3. ANT
C:\user\youruser>cordova platform add android
C:\user\youruser>phonegap create First-app
C:\user\youruser>cd First-app
C:\user\youruser>phonegap run android
Phonegap will be installed and apk will be created in bin folder.
You will be getting
[phonegap] detecting Android SDK environment..
[phonegap] using the local environment
[phonegap] compiling Android...
[phonegap] successfully compiled Android app
[phonegap] trying to install app onto device
[phonegap] successfully installed onto device
You can able to see phonegap modules in C:\Users\yourusername\AppData\Roaming\npm.
Hope this will be very helpful. Let me know if you face any issues.
Phonegap installation steps present on the official site are somewhat vaguely presented and hasn't been properly updated.
With respect to your question, I think this post https://stackoverflow.com/a/18751002/4277415 might help you out.
Cheers.
Install phonegap without any error : http://www.markupjavascript.com/2014/07/installing-phonegap-in-windows.html

Phonegap/cordova add Android Platform on Mac not recognized as core cordova platform

I have an issue with setting up an Android Project on Mac OS.
with the command:
$cordova platform add /path/to/androidSDK/android
I've got the error message:
[Error: Platform "/path/to/androidSDK/android" not recognized as core cordova platform.]
Does anyone have the same Issue ? How can I fix that ?
latest Android SDK version (downloaded today).
Phonegap version: 3.1.0-0.15.0
OSX 10.9 Mavericks
To install the cordova command-line tool, follow these steps:
First of all go through the Cordova Document
For Cordova command-line tools to work, you need to include the SDK's tools and platform-tools directories in your PATH environment. On Mac, you can use a text editor to create or modify the ~/.bash_profile file, adding a line such as the following, depending on where the SDK installs:
export PATH=${PATH}:/Development/adt-bundle/sdk/platform-tools:/Development/adt-bundle/sdk/tools
Next Steps:
Download and install Node.js from Here. Following installation, you should be able to invoke node or npm on your command line.
Install the cordova utility. In Unix(Mac), prefixing the additional sudo command may be necessary to install development utilities in otherwise restricted directories:
For Mac $ sudo npm install -g cordova
once successful installation of cordova is done ,now you can create your application
across all the platforms.
Create the Cordova Application
Go to the directory where you maintain your source code, and run a command such as the following:
$cordova create hello com.example.hello CordovaDemo
hello is the directory where you want to create your application
com.example.hello is the package name
CordovaDemo is the name of the Application
Once Successful creation of your project, some file will be created inside the directory i.e hello
Add Platforms
All subsequent commands need to be run within the project's directory, or any subdirectories within its scope:
$ cd hello
Now you need to specify a set of target platforms, Supported OS for Mac
$ cordova platform add android
plz tell me if you are still having problem.
Hope this will help you.
this is documentation Phonegab docs
and my .bash_profile:
export PATH=${PATH}:$HOME/Development/adt-bundle-mac-x86_64-20140321/sdk/platform-tools:$HOME/Development/adt-bundle-mac-x86_64-20140321/sdk/tools
visit the solution here
I hope this helps you

Categories

Resources