Phonegap Error: “An error occurred while listing Android targets” while installing Phonegap on Ubuntu

谁都会走 提交于 2019-12-05 06:14:12

I could fix this issue by following the cordova-guide. in short:

  1. download the adt-bundle
  2. unzip it to a location of my choice
  3. add the named folders to the PATH variable:

    export PATH=${PATH}:/home/me/opt/adt-bundle/sdk/platform-tools:/home/me/opt/adt-bundle/sdk/tools

hey man if you are using windows then you are missing environment variables. try this for this error: "An error ocurred while listing Android targets"

  1. go to My computer - right click - properties - advance system settings - environment variables.

  2. add some variables needed, I did it like this

examples using my local scenario:

SDKHOME -> C:\development\AndroidADTBundle\ADT\sdk JAVAJDK-> C:\Program Files\Java\jdk1.8.0_05\

  1. Then update the PATH variable Like this: ";%SDKHOME%\tools;%SDKHOME%\platform-tools;%JAVAJDK%\bin"

After doing then do your command, in my case is phonegap instead of cordova. And it should work: COMMAND: phonegap build android

let me know how it goes.

I had the same problem, none of the previous anwsers works for me. The problem is that phonegap is not compatible with Android API 20.

First make sure you have setted all environment variables nedded:

export ANT_HOME=/usr/share/ant
export JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"
export PATH=${PATH}:~/sdk/adt-bundle-linux-x86_64-20140702/sdk/platform-tools/:~/adt/adt-bundle-linux-x86_64-20140702/sdk/tools:$JAVA_HOME/bin:$ANT_HOME/bin

Go to the shell and run android, once there, check the API 19 and install it:

$ android

Now create a device from android avd using API 19 you have downloaded before:

$ android avd

Now try to add the platform to cordova:

$ cordova platform add android

Or check the requirements using cordova check script (~/.cordova/lib/android/cordova/3.5.0/bin/check_reqs)

user3534641

Have you downloaded the Android SDK?

try typeing the command 'android' in command-line or terminal

See the answer I typed out here:

answer

try this one

install ant using brew

Download and install Homebrew by executing following command in terminal:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Install Apache Ant via Homebrew by executing

brew install ant

Run the PhoneGap build again and it should successfully compile and install your Android app.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!