Home » Android » netbeans – Cannot find build.xml (Android)

netbeans – Cannot find build.xml (Android)

Posted by: admin June 15, 2020 Leave a comment

Questions:

I’ve been looking for an asnwer for this for a little while now, but I cant seem to find it. I moved a NeBeans Android project over through perfoce and now I am getting the following error

 ****\ZYAndroidAPP\build.xml:81: Cannot find F:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml imported from ****\ZYAndroidAPP\build.xml

Seems like the build information from Android is not being approriately set by

  <import file="${sdk.dir}/tools/ant/build.xml" />

in in the build script of the project. I tried setting it to the correct path to the SDK and it gave me the same error.

Has anyone had this problem before?

How to&Answers:

Check two things…

A. Make sure your path is set properly in your local.properties file

sdk.dir=/Users/me/Documents/android-sdk-macosx/

B. Make sure your environment variable is set properly:

echo $ANDROID_HOME

If not, then set it:

export ANDROID_HOME=/Users/me/Documents/android-sdk-macosx/

Answer:

As @Justin Breitfeller said the local.properties had a bad sdk path

Answer:

If you are looking for an answer to this, check which android version your app is and which versions are available in the SDK. This error is thrown by netbeans if there is no matching SDK version.

Answer:

I had the same problem and i found a solution :
the directory {sdk_dir}\tools wasn’t here so :

  • download the sdk from the official website
  • copy/paste \tools directory on the first sdk directory

Answer:

First way: find local.properties and change sdk.dir to a correct path where Android SDK is installed.
Second way: change <import file="..." /> to a correct path to SDK.