项目目标(Android L(预览版))未正确加载

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24483406/
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-20 08:16:59  来源:igfitidea点击:

The project target (Android L (Preview)) was not properly loaded

androidandroid-layoutandroid-5.0-lollipop

提问by Kartheek s

Recently I upgraded Eclipsealong with ADT plugins to Android L priew.

最近我EclipseADT plugins 一起升级到Android L priew.

I have the latest Java update as well i.e. Java 8.

我也有最新的 Java 更新,即Java 8.

I was unable to see the layout and it displays as below

我无法看到布局,它显示如下

enter image description here

在此处输入图片说明

采纳答案by Kartheek s

The problem for that is having different jre versions

问题是有不同的 jre 版本

I have java 6 and 8both installed in my system, so I uninstalled java 6 and set path for only java 8.

我已经java 6 and 8都安装在我的系统,所以我卸载Java 6中,并设置路径只有java的8。

But remember to restart the system after setting the paths.

但是记得设置好路径后重启系统。

Now error is gone while viewing android L Preview

现在查看 android L Preview 时错误消失了

回答by Alexandre Landim

Please, note this Android icon in the upper side of the screen

请注意屏幕上方的这个 Android 图标

Android icon

安卓图标

This icon is in the upper side of this screen:

此图标位于此屏幕的上方:

Screen which displays the API version to render the code

显示 API 版本以呈现代码的屏幕

Probably it's displaying the number 20. This is the selection to use the API 20 to render the window. Change it to 19, or 20W (not 20L). It'll fix the problem.

可能它正在显示数字 20。这是使用 API 20 来呈现窗口的选择。将其更改为 19 或 20W(不是 20L)。它会解决问题。

API 19 selected

已选择 API 19

回答by josephus

You may also need to modify eclipse config to run on Java 7 Runtime.

您可能还需要修改 eclipse 配置以在 Java 7 运行时上运行。

Add this to the beginning of eclipse.ini

将此添加到开头 eclipse.ini

-vm
C:/Program Files/Java/jre7/bin

回答by Antilope

For anyone having the same issue: You dont need to unistall Java 6. All you need to do is to set it correctly on Eclipse.

对于遇到相同问题的任何人:您不需要卸载 Java 6。您需要做的就是在 Eclipse 上正确设置它。

  1. First have the JDK fot Java 8 (a.k.a Java 1.8) from: http://www.oracle.com/technetwork/java/javase/downloads/index.html
  2. Install it normally.
  3. Go to the Eclipse Preferences and to Java -> Installed JREs
  4. "Add..." -> Standard VM -> Next and search for the install path (on Mac it will be something like: /Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home).
  5. Enter a nice name like "Java JDK 1.8" and Finish
  6. Make sure to mark the new JRE as shown on the imageenter image description here
  7. Restart Eclipse for the changes to take effect.
  1. 首先从以下位置获取Java 8(又名 Java 1.8)的 JDK:http: //www.oracle.com/technetwork/java/javase/downloads/index.html
  2. 正常安装。
  3. 转到 Eclipse Preferences 和 Java -> Installed JREs
  4. “添加...” -> 标准虚拟机 -> 下一步并搜索安装路径(在 Mac 上,它将类似于:/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home)。
  5. 输入一个好听的名字,比如“Java JDK 1.8”并完成
  6. 确保如图所示标记新的 JRE在此处输入图片说明
  7. 重新启动 Eclipse 以使更改生效。

回答by codewrangler

This seems to be the issue....the 'Automatically Pick Best', picks the 'L' version of API 20 instead of the 4.x version of API 20. In my instance, I am targeting API 19 and apparently that's not compatible with the choice of "API 20: Android L (Preview)".

这似乎是问题......“自动选择最佳”,选择 API 20 的“L”版本而不是 API 20 的 4.x 版本。在我的例子中,我的目标是 API 19,显然这不是与“API 20:Android L(预览版)”的选择兼容。

Sorry, this system won't let me post images yet...

抱歉,这个系统还不允许我发布图片...

回答by noloman

You can see the following note in https://developer.android.com/preview/setup-sdk.html

您可以在https://developer.android.com/preview/setup-sdk.html 中看到以下注释

Note: The Eclipse ADT plug-in requires Java 7 if your compilation target is the L developer preview.

注意:如果您的编译目标是 L 开发人员预览版,则 Eclipse ADT 插件需要 Java 7。

Maybe you don't have Java 7 installed?

也许你没有安装 Java 7?

回答by Ligen Yao

Check your JDK version. It must be JDK1.7. JDK 1.6 does not work.

检查您的 JDK 版本。必须是JDK1.7。JDK 1.6 不起作用。

回答by user4010329

OPen SDK Manager --> Uninstall Android L (API 20,L preview),,use this if you want to resolve this error Quickly

OPen SDK Manager --> Uninstall Android L (API 20,L preview),,如果你想快速解决这个错误,请使用这个

回答by Hai-Yang Li

In my case , my current java version is 1.6.

就我而言,我当前的 Java 版本是 1.6。

So i run the command 'update-alternatives --config java' to change the version to java 1.7, then restart the Eclipse, the problem is fixed.

所以我运行命令'update-alternatives --config java'将版本更改为java 1.7,然后重新启动Eclipse,问题就解决了。

Note:I installed muti-java version(Java 1.6 and java 1.7)

注意:我安装了 muti-java 版本(Java 1.6 和 java 1.7)

Hope help to you.

希望对你有帮助。

回答by Sgdva

What I did after updating java was to set the variable system for java again

更新java后我所做的是再次为java设置变量系统

Advanced System Settings -> Advanced -> Environment variables.

高级系统设置 -> 高级 -> 环境变量。

I updated JAVA_HOME with this directory

我用这个目录更新了 JAVA_HOME

C:\Program Files\Java\jdk1.7.0_60

C:\Program Files\Java\jdk1.7.0_60

Back in eclipse, you can either:

回到 Eclipse,您可以:

Click Properties -> Android -> Project Build Target

点击属性 -> Android -> 项目构建目标

Change android L for android 4.4

为 android 4.4 更改 android L

If you want to use android L, then change in the manifest minSdkVersion to "L"

如果你想使用android L,那么在manifest minSdkVersion 中更改为“L”