I am trying to setup a basic "hello world" PhoneGap project. I've been walking through the steps found at http://docs.phonegap.com/en/2.7.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android. I am doing this on a Windows 7 Ultimate machine.
I have successfully setup Java and Ant. I have confirmed this by typing "javac -version" in a command prompt (1.6.0_39 is shown). When I type "ant" in a command prompt, I receive a message that says "Buildfile: build.xml does not exist! Build failed". At this point, I'm confident I've done everything properly through step 3. However, when I get to step 4, I run into issues.
On step 4 when I type "create C:\Tests\Android Test MyNamespace.Test.Android" in a command prompt, I receive an error that says: "create is not recognized as an internal or external command, operable program or batch file.". What could be wrong? Where does "create" come from? I'm in the /Cordova/phonegap-2.7.0/phonegap-2.7.0/lib/android directory when I run the command, I receive the following error:
Creating new android project...
Copying template files...
Copying js, jar & config.xml files...
Copying cordova command tools...
Updating AndroidManifest.xml and Main Activity...
C:\Program Files\Cordova\phonegap-2.7.0\phonegap-2.7.0\lib\android\bin\create.js
(31, 5) Microsoft JScript runtime error: Path not found
I can see the create.js file. However, for some reason I'm getting this "Path not found" error. Did I enter an incorrect command prompt parameter? I keep staring at it and everything looks correct.
Thank you!
Same problem here...
Strangely if I run the comand "Create" with no parameters, it creates a folder "example" with a sample app, without the error
I found the answer in: https://groups.google.com/d/msg/phonegap/tnz2DnUE-E0/ADZibhwHGpYJ
The problem is with this line in "create.js":
var ACTIVITY_PATH=PROJECT_PATH+'\\src\\'+PACKAGE_AS_PATH+'\\'+ACTIVITY+'.java';
[...]
exec('%comspec% /c copy "'+ROOT+'"\\bin\\templates\\project\\Activity.java '+ ACTIVITY_PATH +' /Y');
The Windows "copy" command will not create directories that don't exist, so the command above fails because "src\PACKAGE_AS_PATH" doesn't exist. This can be fixed with:
var ACTIVITY_DIR=PROJECT_PATH + '\\src\\' + PACKAGE_AS_PATH;
var ACTIVITY_PATH=ACTIVITY_DIR+'\\'+ACTIVITY+'.java';
[...]
exec('%comspec% /c mkdir ' + ACTIVITY_DIR);
exec('%comspec% /c copy "' + ROOT + '"\\bin\\templates\\project\\Activity.java ' + ACTIVITY_PATH + ' /Y');
Check your environment path:
Set Environment variables:
Path:
Start -> Control Panel -> System and Security -> System -> Environment variables
Or
Mycomputer -> Right Click -> properties -> Advance System settings -> Environment variables
1. Java JDK
2. Android SDK
3. ANT
User variables for user1:
Path: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Users\user1\AppData\Roaming\npm\
Temp:
%USERPROFILE%\AppData\Local\Temp
System variables:
ANDROID_HOME: C:\Nithi\software\Android_sdk\adt-bundle-windows-x86_64-20131030\adt-bundle-windows-x86_64-20131030\sdk\
Path:
ANT_HOME: C:\ant
JAVA_HOME: C:\Program Files\Java\jdk1.7.0_45\
JAVA_PATH: C:\Program Files (x86)\Java\jre7\bin
Path: c:\Program Files (x86)\Intel\iCLS Client\;c:\Program Files\Intel\iCLS Client\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\nodejs\;%ANT_HOME%\bin;%JAVA_HOME%\bin;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
is your Environment variables set for JAVA and ANT? Also, can you share the create command you are using? There should be no spaces in package names.
You should be in Cordova/phonegap-2.7.0/phonegap-2.7.0/lib/android/bin directory. Then type:
create {path} {project.with.dots} {YourProjectName}.
For example, I just ran:
C:\server\cordova\phonegap-2.7.0\phonegap-2.7.0\lib\android\bin> create ../MyTest my.test.com MyTestProject and it created MyTest folder in C:\server\cordova\phonegap-2.7.0\phonegap-2.7.0\lib\android\.
Also, if you do echo %PATH%, you should see the directories to your ant\bin, android-sdk\tools, android-sdk\platform0tools, and %JAVA_HOME%.
I think you should put your path to the project directory in "" otherwise the create script will interpret "Test" as the package name, which is obviously not a valid package name.
So command should read:
create "C:\Tests\Android Test" MyNamespace.Test.Android AndroidTest
It looks like the project name cannot have dots in it.
C:\Phonegap\android\bin>create c:\android\helloworld3 com.hello.world helloworld
Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft
Corporation. All rights reserved.
C:\Phonegap\android\VERSION Creating new android project... Copying
template files... Copying js, jar & config.xml files... Copying
cordova command tools... Updating AndroidManifest.xml and Main
Activity... c:\android\helloworld3\src\com\hello\world\helloworld.java
c:\android\helloworld3\src\com\hello\world\helloworld.java
c:\android\helloworld3\AndroidManifest.xml
c:\android\helloworld3\AndroidManifest.xml
c:\android\helloworld3\AndroidManifest.xml
(works ok)
But...
C:\Phonegap\android\bin>create c:\android\helloworld4 com.hello.world hello.world
Microsoft (R) Windows Script Host Version 5.8 Copyright
(C) Microsoft Corporation. All rights reserved.
C:\Phonegap\android\VERSION Creating new android project... Copying
template files... Copying js, jar & config.xml files... Copying
cordova command tools... Updating AndroidManifest.xml and Main
Activity...
c:\android\helloworld4\src\com\hello\world\hello.world.java
C:\Phonegap\android\bin\create.js(32, 5) Microsoft JScript runtime
error: Path not found
(fails)
Unhelpful error message though.
Related
I have a simple batch script that is building a Xamarin forms project. It works when I run it manually on the machine, but it fails when I try to run it as a build step through Jenkins. I get the following error:
Did not find Android SDK
C:\Program Files x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(567,2): error XA5205: The Android SDK Directory could not be found.
Please set via /p:AndroidSdkDirectory.
I'm pretty sure I have all of my environment system variables set correctly.
PATH includes C:\Program Files\Android\android-sdk
I also have ANDROID_HOME set to C:\Program Files\Android\android-sdk as well. I have not set it via /p:AndroidSdkDirectory (which I plan on doing now) but I am still interested in why it can't find it through PATH or ANDROID_HOME. Any help would be greatly appreciated! Thanks!
EDIT:
My batch file:
SET projectPath=%1
SET projectName=%2
SET keystorePath=%3
SET password=%4
SET alias=%5
SET config=%6
SET apkName=%7
msbuild %projectPath%\%projectName% /p:Configuration=%config% /t:Clean
msbuild %projectPath%\%projectName% /p:Configuration=%config% /t:PackageForAndroid /p:AndroidSdkDirectory="C:\Program Files\Android\android-sdk"
jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore %keystorePath% -storepass %password% -signedjar %projectPath%\bin\%config%\com.company.helloworld-signed.apk %projectPath%\bin\%config%\com.company.helloworld.apk %alias%
zipalign -f -v 4 %projectPath%\bin\%config%\com.company.helloworld-signed.apk %projectPath%\bin\%config%\%apkName%.apk
My system variables:
ANDROID_NDK_PATH "C:\Program Files\Android\android-ndk-rl3b"
ANDROID_SDK_HOME "C:\Program Files\Android\android-sdk"
ComSpec C:\Windows\system32\cmd.exe
SDK_HOME C:\Program Files\Java\jdk1.8.0_121
NUMBER_OF_PROCESSORS 4
OS Windows_NT
My system PATH:
C:\ProgramData\Oracle\Java\javapath
%SystemRoot%\system32
%SystemRoot%
%SystemRoot%\System32\Wbem
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static
C:\Program Files (x86)\Skype\Phone\
%USERPROFILE%\.dnx\bin
C:\Program Files\Microsoft DNX\Dnvm\
C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit
C:\Program Files\Microsoft SQL Server\130\Tools\Binn\
C:\Program Files\Perforce
C:\Program Files\Perforce\DVCS\
C:\Program Files (x86)\MSBuild\14.0\Bin
C:\Program Files\Java\jdk1.8.0_121
C:\Program Files\Android\android-sdk
C:\Program Files\Java\jre1.8.0_121\bin
C:\Program Files\Java\jdk1.8.0_121\bin
C:\Program Files\Android\android-sdk\build-tools\25.0.2
I have installed Jenkins as a Windows service.
It is interesting that the error message line
C:\Program Files x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(567,2):
Contains a space character instead of an opening parenthesis ( left of x86.
The system PATH environment variable should not have as first directory path
C:\ProgramData\Oracle\Java\javapath
This should be the fifth directory path in the list of directories.
I don't have Android SDK installed ever on one of my Windows computers, but I find it curious that the directory paths of ANDROID_SDK_HOME and ANDROID_SDK_HOME are defined with the surrounding double quotes included.
That can be right, but could cause also problems depending on how those two environment variables are referenced by batch files or used in applications.
Directory paths are assigned to environment variables usually without surrounding double quotes.
On the batch file the handling of first and second argument could be a problem.
SET projectPath=%1
SET projectName=%2
msbuild %projectPath%\%projectName% /p:Configuration=%config% /t:Clean
If project path or project name contains a space character or one of these characters &()[]{}^=;!'+,`~ they must be specified being enclosed in double quotes on starting the batch file. It is common practice to pass directory paths, file names and other parameters to batch files enclosed in double quotes.
The first and second argument are assigned to the environment variables projectPath and projectName as defined on command line on starting the batch file which means without or with surrounding double quotes. In case of project path and project name are enclosed in double quotes, the third line is expanded before execution for example to:
msbuild "C:\Project Path"\"Project Name" /p:Configuration=xxx /t:Clean
That is not good. It could work depending on how good error correction of Windows command interpreter respectively the kernel functions of Windows are. But it would be definitely better to make sure the double quotes are removed on assigning the batch file arguments to environment variables and enclose the parameter strings in double quotes where it is needed or at least strongly recommended on referencing them in the command lines below.
It would make also sense in a batch file used by Jenkins to avoid dependency of the environment variables PATH and PATHEXT as much as possible especially on running Jenkins as service with system account by specifying the applications to execute with full path and with file extension not using environment variables or using system environment variables defined by Windows itself.
Here is a batch code written without having Jenkins, MSBuild, Java SDK, Java JDK or Android SDK installed at all with assuming that the config parameter is a short word never containing any critical character.
set "projectPath=%~1"
set "projectName=%~2"
set "keystorePath=%~3"
set "password=%~4"
set "alias=%~5"
set "config=%~6"
set "apkName=%~7"
rem Get directory paths of used applications for build task.
for /D %%I in ("%ProgramFiles(x86)%\MSBuild\*") do set "MSBUILD_PATH=%%I\Bin"
for /D %%I in ("%ProgramFiles%\Java\jdk*") do set "JAVA_JDK_PATH=%%I\bin"
"%MSBUILD_PATH%\msbuild.exe" "%projectPath%\%projectName%" /p:Configuration=%config% /t:Clean
"%MSBUILD_PATH%\msbuild.exe" "%projectPath%\%projectName%" /p:Configuration=%config% /t:PackageForAndroid /p:AndroidSdkDirectory="%ProgramFiles%\Android\android-sdk"
"%JAVA_JDK_PATH%\jarsigner.exe" -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore "%keystorePath%" -storepass "%password%" -signedjar "%projectPath%\bin\%config%\com.company.helloworld-signed.apk" "%projectPath%\bin\%config%\com.company.helloworld.apk" "%alias%"
"%JAVA_JDK_PATH%\zipalign.exe" -f -v 4 "%projectPath%\bin\%config%\com.company.helloworld-signed.apk" "%projectPath%\bin\%config%\%apkName%.apk"
I don't know if it is really a good idea to find with the batch file the MSBuild and the Java JDK path or using a system environment variable. The automatic search for MSBuild and Java JDK paths might not be a good idea if having multiple versions of MSBuild and/or Java JDK installed.
However, assigning the batch file arguments to the environment variables with removing enclosing double quotes as done with %~1, %~2, ... and later enclose the variable parameter strings in double quotes is highly recommended.
The help output by running in a command prompt window call /? explains which modifiers can be used on referencing arguments.
Pages found with a www search engine related to this issue:
Visual Studio : The Android SDK Directory could not be found. Please set via /p:AndroidSdkDirectory
Resolving “The Android SDK Directory could not be found” building a Xamarin app via TFS build server
Visual Studio : The Android SDK Directory could not be found
The Android SDK Directory could not be found.
Those web pages are 4 of top 7 results on searching with my preferred world wide web search engine for the term "Android SDK Directory could not be found" enclosed in double quotes as posted here to find pages containing exactly this term.
One more hint:
System environment variables defined or edited by the user via Windows Control Panel become effective only for applications and services started after the modification.
All services, processes and applications already running have already their own set of environment variables created by Windows automatically in memory of already running service/process/application derived from parent process on starting the service/process/application.
It is not possible that a parent process manipulates the environment variables of any running child process nor can a child process manipulate the environment variables of its parent process.
Every process has its own environment variables list created by Windows automatically as copy of environment variables list of the process starting the new process.
So for Windows services running in background a modification of a system environment variable needs at least stopping and restarting the service or perhaps even restarting Windows depending on what is the parent process of the running Windows service.
C:\Users\saurabh.trivedi\.cordova\lib\android\cordova\3.3.0\bin\node_modules\q\q
.js:126
throw e;
^
Error: ERROR : executing command 'ant', make sure you have ant installed and add
ed to your path.
at C:\Users\saurabh.trivedi\.cordova\lib\android\cordova\3.3.0\bin\lib\check
_reqs.js:47:27
I faced similar error. To overcome the issue I downloaded and installed apache-ant-1.9.2 into the "C:\Program Files\apache-ant-1.9.2\" folder and added the "C:\Program Files\apache-ant-1.9.2\bin\;" to the "Path" environment variable.
Note, that additional environment variables (ANDROID_HOME) and paths to JRE, and Android SDK are also should be set for correct Cordova CLI operation under Windows for me:
ANDROID_HOME = C:\Program Files (x86)\ADT\sdk
Path = ...<some paths for other programs>... + C:\Windows\Microsoft.NET\Framework\v4.0.30319\;C:\Program Files\apache-ant-1.9.2\bin\;C:\Program Files (x86)\Java\jre7\bin\;C:\Program Files (x86)\ADT\sdk\tools\
I faced the same issue. here is the exact solution.
Control Panel\System and Security\System\
click advanced system settings
click Environment variables
In system variables :
ANT_HOME: C:\ant
path: %ANT_HOME%\bin;
This will work..
Config Details:
Windows 8 Pro 32bit
adt-bundle-windows-x86-20130717
jdk-6u26-windows-i586 32bit
Directories:
For Java - C:\Program Files\Java\jdk1.6.0_26
For Android Root - Z:\Program Files\Android
For Android SDK - Z:\Program Files\Android\sdk
Environmental Variables:
var_name: JAVA_HOME
var_value: C:\Program Files\Java\jdk1.6.0_26\
var_name: JDK_HOME
var_value: C:\Program Files\Java\jdk1.6.0_26\
var_name: Path
var_value: C:\Program Files\Java\jdk1.6.0_26\bin
Modification:
1)
set java_exe=
"%JAVA_HOME%\bin\java.exe"
if not defined java_exe goto :EOF
2)
for /f %%a in ('"%~dps0\find_java.exe" -s') do set java_exe=%%a
3)
for /f %%a in ('"%~dps0\find_java.exe" -s -w') do set javaw_exe=%%a
First i downloaded adt-bundle then extracted into Android Root directory (i installed java far earlier) then i installed ADT Plugins from https://dl-ssl.google.com/android/eclipse/ and successfully connected Eclipse IDE with Android SDK. Now i am trying to Android SDK Components but when i clicked on Window-> Android SDK Manager in Eclipse a dialogue box opened said SDK Manager will open in a while but it didn't. Whenever i try to open SDK Manager everytime a cmd prompt for a second then disappear and nothing happened while AVD Manager open properly.
Then i went through some solution in several forums and modified some line of code (as of modification 1 in tools\android.bat ; 2 and 3 in tools\lib\find_java.bat)
Now in command line
Z:\Program Files\Android\sdk\tools>android
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-client to select the "client" VM
-server to select the "server" VM
-hotspot is a synonym for the "client" VM [deprecated]
The default VM is client.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -jre-no-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
Z:\Program Files\Android\sdk\tools>
As you can see that my attempts are successful and android.bat is executing but the problem is when i try to open SDK Manager directly or via IDE again nothing happened but executing in cmd. I cannot understand what happening actually and i am unable to found anything related with this in any forum. Please Help. Thanks in advance.
In your PATH environmental variable, move *C:\Program Files\Java\jdk1.6.0_26\bin* to the beginning of the collection, and see if that addresses the issue.
Most likely the directory structure of your sdk installation changed. Try running android.bat from the sdk directory
Z:\Program Files\Android\sdk>tools\android.bat
If the sdk Manager opens (close it) and set the work_dir in android.bat to the sdk directory. In android.bat change line
set work_dir="%cd%"
to
set work_dir="Z:\Program Files\Android\sdk"
or to
set work_dir="%~dp0.."
If the above does not work try to get more information what is wrong in calling java, output the java call to the console. In android.bat change line
call %java_exe% .....
to
echo call %java_exe% .....
Good luck
android.bat seems to have a problem running from a samba share mounted on my windows system. This fixes the problem for me.
V:\>android
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
[snip]
V:\>c:
C:\Users\me>android
I had this same problem and I found that none of the "set" commands in beginning of the batch file worked correctly.
prog is set to ~f0.
work_dir is empty
cd /d ~dp0 results in an error "The filename, directory name, or volume label syntax is incorrect."
Android.bat requires command extensions enabled in order to run correctly.
Restore the original batch file and edit this line
from...
setlocal
to...
setlocal enableExtensions
This should set all the environment variables correctly so that they don't need to be hard coded.
You can also enable command extensions in the registry. Reboot after making this change.
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions = 1
I put in reference this:
http://developer.android.com/guide/google/gcm/demo.html
in Using App Engine for Java number 4
I am supposed to run this on a cmd inside the samples/gcm-demo-appengine directory :ant -Dsdk.dir=/opt/google/appengine-java-sdk runserver -Dserver.host=192.168.1.10
I replace the "192.168.1.10" with "127.0.0.1" which is my locolhost.
after executing this command I got:
BUILD FAILED
C:\Program Files (x86)\Android\android-sdk\extras\google\gcm\samples\gcm-demo-ap
pengine\build.xml:27: Cannot find C:\opt\google\appengine-java-sdk\config\user\a
nt-macros.xml imported from C:\Program Files (x86)\Android\android-sdk\extras\go
ogle\gcm\samples\gcm-demo-appengine\build.xml
can you tell me what the problem?
Go to the following link:
[https://developers.google.com/appengine/downloads#Google_App_Engine_SDK_for_Java]
And download appengine-java-sdk-1.9.3.zip
So than extract it where you want and use the following path for example:
C:\programs\appengine-java-sdk-1.9.3
so you will use :
ant -Dsdk.dir=C:\programs\appengine-java-sdk-1.9.3 runserver -Dserver.host=1.1.1.1
where you have to replace 1.1.1.1 with your server's ip
I'm trying to follow the setup instructions on phonegap-android's wiki page, but I'm having trouble. I've got all of the prereqs/path variables/etc set-up, but when I execute the command (in gitbash as per the instructions) for building the project, I get errors which I do not understand.
Here is the script which I run:
$ ruby ./droidgap "C:/android-sdk-windows" pgtest com.example.android.pgtest "C
:/xfer/input" "C:/xfer/output"
and here is the result I get:
Building the JAR...
'/*' is not recognized as an internal or external command,
operable program or batch file.
'Licensed' is not recognized as an internal or external command,
operable program or batch file.
'contributor' is not recognized as an internal or external command,
operable program or batch file.
'this' is not recognized as an internal or external command,
operable program or batch file.
'The' is not recognized as an internal or external command,
operable program or batch file.
you was unexpected at this time.
Creating Android project for target level 8
Adding www folder to project...
Generating manifest...
Copying over libraries and assets and creating phonegap.js...
c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1418:in stat': No such file or directory
- c:/Users/<user>/Desktop/phonegap/framework/phonegap.jar (Errno::ENO
ENT)
from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1418:inblock in fu_each_sr
c_dest'
from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1432:in fu_each_src_dest0'
from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1416:infu_each_src_dest'
from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:391:in cp'
from ./droidgap:82:incopy_libs'
from ./droidgap:20:in run'
from ./droidgap:157:in'
I've looked through the phonegap forums, and I've found some hits on part of the error (the part where phonegap.jar could not be found), but nothing on the first part ("_ is not recognized", etc.). What am I doing wrong? Thanks.
Additional info:
-Windows 7 (32 bit)
-ruby 1.9.1
-java jdk1.6.0_21
-ant 1.8.1
Got it working. I remembered reading that windows users sometimes needed to add ".bat" to the end of certain commands, so I changed ant to ant.bat in the droidgap script and it worked.
Also, this guy had the same issue as me and I somehow missed it.
I've had various problems with building the Example PhoneGap App (http://wiki.phonegap.com/w/page/16494774/Getting-started-with-Android-PhoneGap-in-Eclipse)
Some of the error messagesI had are:
- in `': No such file or directory - android-sdk-path.bat android.bat (Errno::ENOENT)
- instat': No such file or directory - ~/projects/phonegap-android/framework/phonegap.jar
BUT IT'S NOW FIXED!!!
To fix the issues I had to tweak a lot of things , so I'm not too sure which one fixed what, but here's my system in the end (note: I'm on Windows Vista)
COMPATIBLE versions
- apache ant 1.8.2
- Ruby 1.8.7
- Java SDK 1.6
- Git Bash 1.7.3.1
Environment Variables:
- ANDROID_HOME = \android-sdk-windows
- ANT_HOME = \apache-ant-1.8.2
- JAVA_HOME = \jdk1.6.0_13
- RUBY_HOME = \Ruby187
- PHONEGAP_ANDROID = \phonegap-android
- Path - add these %JAVA_HOME%\bin;%ANT_HOME%\bin;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;%RUBY_HOME%
\bin;%PHONEGAP_ANDROID%\bin
Using Git Bash - use NEW METHOD - ruby bin/droidgap create example
RESULT: successfully created two outputs; a file called 'PhoneGap.jar' and an Android Eclipse project to be imported into Eclipse
Hope this helps