项目目标(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
The project target (Android L (Preview)) was not properly loaded
提问by Kartheek s
Recently I upgraded Eclipse
along with ADT plugin
s to Android L priew
.
最近我Eclipse
和ADT plugin
s 一起升级到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
我无法看到布局,它显示如下
采纳答案by Kartheek s
The problem for that is having different jre versions
问题是有不同的 jre 版本
I have java 6 and 8
both 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 图标
This icon is in the upper side of this screen:
此图标位于此屏幕的上方:
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)。它会解决问题。
回答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 上正确设置它。
- First have the JDK fot Java 8 (a.k.a Java 1.8) from: http://www.oracle.com/technetwork/java/javase/downloads/index.html
- Install it normally.
- Go to the Eclipse Preferences and to Java -> Installed JREs
- "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).
- Enter a nice name like "Java JDK 1.8" and Finish
- Make sure to mark the new JRE as shown on the image
- Restart Eclipse for the changes to take effect.
- 首先从以下位置获取Java 8(又名 Java 1.8)的 JDK:http: //www.oracle.com/technetwork/java/javase/downloads/index.html
- 正常安装。
- 转到 Eclipse Preferences 和 Java -> Installed JREs
- “添加...” -> 标准虚拟机 -> 下一步并搜索安装路径(在 Mac 上,它将类似于:/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home)。
- 输入一个好听的名字,比如“Java JDK 1.8”并完成
- 确保如图所示标记新的 JRE
- 重新启动 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”