Java 无法在eclipse中选择Android Build Target

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4122008/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 11:50:28  来源:igfitidea点击:

Android Build Target cant be selected in eclipse

javaandroideclipse

提问by Alex Amato

I followed these tutorials to set up a Hello World Android app. But when I create a new java project I can't select a build target. It just says no targets available in the target selection box. I have confirmed that I am not having the UI issue described here (http://blog.rowancrane.com/2009/12/27/eclipse-new-android-project-cant-select-build-type-target), I actually have a message in the box saying there are no targets instead of an empty box. I also am using 1920x1080 res.

我按照这些教程设置了一个 Hello World Android 应用程序。但是当我创建一个新的 java 项目时,我无法选择构建目标。它只是说目标选择框中没有可用的目标。我已经确认我没有这里描述的 UI 问题(http://blog.rowancrane.com/2009/12/27/eclipse-new-android-project-cant-select-build-type-target),我实际上在框中有一条消息说没有目标而不是一个空框。我也在使用 1920x1080 分辨率。

I'm guessing that eclipse is just not aware of my Android Targets? I installed them in the android SDK manager and see them listed under installed packages in the Android SDK manager (1.1, 1.6, ..., 2.2)

我猜 eclipse 只是不知道我的 Android 目标?我将它们安装在 android SDK 管理器中,并在 Android SDK 管理器 (1.1, 1.6, ..., 2.2) 中的已安装软件包下看到它们列出

http://fyi.oreilly.com/2009/02/setting-up-your-android-develo.htmlhttp://developer.android.com/resources/tutorials/hello-world.html

http://fyi.oreilly.com/2009/02/setting-up-your-android-develo.html http://developer.android.com/resources/tutorials/hello-world.html

Any suggestions on how I can create the project and get started? Thanks in advance

关于如何创建项目并开始使用的任何建议?提前致谢

回答by Wroclai

In Eclipse, do this:

Eclipse 中,执行以下操作:

Window-> Preferences-> (In the field "SDK Location", add your path to your Android folder, e.g. "C:\android-sdk-windows" and then click "Apply" -> OK.

窗口->首选项-> (在“ SDK 位置”字段中,将您的路径添加到您的 Android 文件夹,例如“ C:\android-sdk-windows”,然后单击“应用”->确定

Now you should be able to select a target.

现在您应该能够选择一个目标。

回答by wonne

Don't create a Java Project, instead create an Android Project. In the setup steps you can define a build target. Hope this helps.

不要创建 Java 项目,而是创建一个 Android 项目。在设置步骤中,您可以定义构建目标。希望这可以帮助。

回答by Neil Han

For MAC users,

对于 MAC 用户,

In Eclipse, do this:

在 Eclipse 中,执行以下操作:

Eclipse -> Preferences -> Android -> (In the field "SDK Location", add your path to your Android folder, e.g. "/Users/user/Projects/Android/android-sdk-mac_x86" and then click "Apply" -> OK.

Eclipse -> 首选项 -> Android ->(在“SDK 位置”字段中,将您的路径添加到您的 Android 文件夹,例如“/Users/user/Projects/Android/android-sdk-mac_x86”,然后单击“应用”- > 好的。

Now you should be able to select a target.

现在您应该能够选择一个目标。

回答by Jithesh Borgia

Please make sure that at least one version of Android SDK is installed. To check this, go to window > Android SDK Manager.

请确保至少安装了一个版本的 Android SDK。要检查这一点,请转到窗口 > Android SDK 管理器。

回答by vedansh

just upgrade android sdk ools to rev. 22.6.2 n problem will be solved,at least my problem is solved

只需将 android sdk ools 升级到 rev。22.6.2 n 问题会解决,至少我的问题解决了