1

I am using php and want to craete a android application folder using phonegap.

I tried the following command shell_exec('cd C:\Desktop\phonegap-2.4.0\lib\android\bin && create C:\phpshell3 com2.wesdr.ddxf dcddf')

but it is giving the following error:

Missing one of the following:
JDK
Android SDK
Apache ant

But when i execute the same command directly over command prompt it runs fine. How to execute phonegap-android create command using php script on command prompt?

SchmitzIT
  • 9,227
  • 9
  • 65
  • 92
user2055581
  • 53
  • 1
  • 4

3 Answers3

2

This isn't a PHP issue. It looks like you're missing the Android SDK. You'll probably need to download and install it first.

0

you may try coment out the conditional statement in create.bat

::FOR %%X in (android.bat) do (
    ::SET FOUND=%%~$PATH:X
    ::IF NOT DEFINED FOUND GOTO MISSING
::)
ZHAO Xudong
  • 1,371
  • 1
  • 12
  • 21
0

to install jdk u can find it here: https://jdk7.java.net/download.html
after installation jdk u should add JAVA_HOME to enviroments in windows machines.
like here:How to set java_home on Windows 7?

then download android sdk and add its path to enviroments. after sdk download ant from http://ant.apache.org/bindownload.cgi and put its bin folder into enviroment like sdk u did.

to test java enter 'java' in cmd and 'ant' for ant and 'android avd' for sdk.
they must have result

Community
  • 1
  • 1
moni as
  • 977
  • 6
  • 13