简体   繁体   English

找不到build.xml(Android)

[英]Cannot find build.xml (Android)

I've been looking for an asnwer for this for a little while now, but I cant seem to find it. 我一直在寻找一个asnwer现在,但我似乎无法找到它。 I moved a NeBeans Android project over through perfoce and now I am getting the following error 我通过perfoce移动了一个NeBeans Android项目,现在我收到以下错误

 ****\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 似乎来自Android的构建信息没有被合理地设置

  <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. 我尝试将其设置为SDK的正确路径,它给了我同样的错误。

Has anyone had this problem before? 以前有人有这个问题吗?

Check two things... 检查两件事......

A. Make sure your path is set properly in your local.properties file A.确保在local.properties文件中正确设置了路径

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

B. Make sure your environment variable is set properly: B.确保您的环境变量设置正确:

echo $ANDROID_HOME

If not, then set it: 如果没有,那么设置它:

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

正如@Justin Breitfeller所说,local.properties有一个糟糕的sdk路径

If you are looking for an answer to this, check which android version your app is and which versions are available in the SDK. 如果您正在寻找答案,请检查您的应用程序是哪个Android版本以及SDK中可用的版本。 This error is thrown by netbeans if there is no matching SDK version. 如果没有匹配的SDK版本,netbeans会抛出此错误。

I had the same problem and i found a solution : the directory {sdk_dir}\\tools wasn't here so : 我有同样的问题,我找到了一个解决方案:目录{sdk_dir} \\ tools不在这里:

  • download the sdk from the official website 从官方网站下载sdk
  • copy/paste \\tools directory on the first sdk directory 在第一个sdk目录下复制/粘贴\\ tools目录

First way: find local.properties and change sdk.dir to a correct path where Android SDK is installed. 第一种方法:找到local.properties并将sdk.dir更改为安装Android SDK的正确路径。 Second way: change <import file="..." /> to a correct path to SDK. 第二种方法:将<import file="..." />更改为SDK的正确路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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