简体   繁体   中英

Running Phonegap Android app on OSX

I am trying, to no avail, to run an Android version of a Phonegap app I have made.

The app works fine on iOS when running:

phonegap run ios

However, when I run:

phonegap run android

I get

[phonegap] executing 'cordova run android'...
[phonegap] completed 'cordova run android'`

But nothing happens. When I run:

phonegap run android --verbose

I get the error(s):

BUILD FAILED
/usr/local/Cellar/android-sdk/24.1.2/tools/ant/build.xml:601: The following error occurred while executing this line:
/usr/local/Cellar/android-sdk/24.1.2/tools/ant/build.xml:653: The following error occurred while executing this line:
/usr/local/Cellar/android-sdk/24.1.2/tools/ant/build.xml:698: null returned: 1

and

ERROR running one or more of the platforms: Error: /Users/*/Google Drive/Websites/angular-phonegap/*/platforms/android/cordova/run: Command failed with exit code 1
You may not have the required environment or OS to run this project

I faced a similar problem in the past that involved editing my PATH variable, not sure if this is the same issue or what. In any case, any help is greatly appreciated.

Thanks

i think that you not have all requirements, please check another time, as you can see here , cordova fail with this error where not find a specific platform command to run. Follow these instruction:

  1. Check that the java sdk is already installed and already in your Path.
  2. Check to have already installed android studio or sdk standalone and the bin folder of the sdk is in Path.
  3. Check to have installed ant ( on Mac install it with brew, this is the best option ) and to have it in path.

For a complete list to check refer to this cordova docs .

Be patient and follow the step one by one, your problem must be in one of these steps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM