Skip to content
This repository has been archived by the owner on Apr 11, 2022. It is now read-only.

Newbie Q: can't build android #117

Closed
GottaGetmedat opened this issue Jul 26, 2013 · 3 comments
Closed

Newbie Q: can't build android #117

GottaGetmedat opened this issue Jul 26, 2013 · 3 comments

Comments

@GottaGetmedat
Copy link

I've just been using Dreamweaver and the plugin to PhoneGap until now, so this happens, when you type the command to build for android platform...
phonegap local build android

[phonegap] adding the Android platform...
[warning] missing library cordova/android/3.0.0
[phonegap] downloading https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=snapshot;h=3.0.0;sf=tgz...
[error] The command android failed. Make sure you have the latest Android SDK installed, and the android command (inside
the tools/ folder) added to your path. Output: 'android' is not recognized as an internal or external command,
operable program or batch file.

@GottaGetmedat
Copy link
Author

okay so I downloaded Apache Cordava 3.0.0 from
http://cordova.apache.org/#download
and added the unzipped folder of zip files to my path (not clear if you need to unzip all the zips or not).
and I downloaded the ADT Bundle from
http://developer.android.com/sdk/index.html
and added to the path the sdk folder inside the folder it unzipped to (along with the eclipse folder and SDKManager.exe
so I still get this error when I type phonegap local build android from a newly created app folder...

[phonegap] adding the Android platform...
[error] The command android failed. Make sure you have the latest Android SDK installed, and the android command (inside
the tools/ folder) added to your path. Output: 'android' is not recognized as an internal or external command,
operable program or batch file.

@GottaGetmedat
Copy link
Author

As it says you need to also add the Tools folder to the path then you'll get this error...
[phonegap] adding the Android platform...
[error] An error occured during creation of android sub-project. The JAVA_HOME environment variable is not set.
Set JAVA_HOME to an existing JRE directory.
Remember to also add JAVA_HOME to the PATH variable.
After updating system variables, open a new command window and retry.
So it seems maybe you need to get the JDK SE from...
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
In my case that I think is currently jdk-7u25-windows-x64.exe
I think them you have to create it manually and set it to...
JAVA_HOME
C:\Program Files\Java\jre7
Then you'll get this error...
[phonegap] adding the Android platform...
[error] An error occured during creation of android sub-project. Cannot locate javac.exe using the PATH environment variable.
Retry after adding directory containing javac.exe to the PATH variable.
Remember to open a new command window after updating the PATH variable.
Visit http://java.oracle.com if you need to install Java (JDK).
wait maybe that's
C:\Program Files\Java\jdk1.7.0_25\jre
and ultimately needed in the path is
C:\Program Files\Java\jdk1.7.0_25\bin

okay now I get this error...
C:\MasterDomain\Sites\SF_phonegap\SexFormula>phonegap local build android
[phonegap] adding the Android platform...
[error] An error occured during creation of android sub-project. Cannot locate ant.bat using the PATH environment variable.
Retry after adding directory containing ant.bat to the PATH variable.
Remember to open a new command window after updating the PATH variable.
Visit http://ant.apache.org if you need to install Apache Ant.

so actually from here
http://ant.apache.org/bindownload.cgi
current version 1.9.2 (just released?!)
and then I add something like this to the PATH env var as well...
C:\Library\Dev\ApacheANT\apache-ant-1.9.2\bin

then it will work.

I'm thinking you should add a link in-between
"Install" and "Getting Started"
something like "Critical other components required Installation Instructions and Path configurations setup etc...."

@GottaGetmedat
Copy link
Author

So as a final note getting the emulator to run is not so straight forward as is the SDKManager.
To get the "Android SDK Manager" to run so you can Update just run the tools/android.bat of all things... yup totally bizarre.
To run the emulator I have a bat with this...
C:\Library\Dev\Android\adt-bundle-windows-x86_64-20130717\sdk\tools\emulator.exe -avd droid18
but first you have to create it with something like...
android create avd -n droid18 -t 2
a good explanation of that is found here...
http://developer.android.com/tools/devices/managing-avds-cmdline.html

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant