无法加载 android 项目的属性文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3288058/
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
Failed to load properties file for android project
提问by folone
I finally was able to build and debug the android platform with this tutorial. I imported my project in eclipse, and afterwards installed ADT. Then I converted my imported project to android project (Android Tools -> Convert To Android Project
). And now I'm having Failed to load properties file for project 'droid-platform'
error. Session data:
我终于能够使用本教程构建和调试 android 平台。我在 eclipse 中导入了我的项目,然后安装了ADT。然后我将我导入的项目转换为 android 项目 ( Android Tools -> Convert To Android Project
)。现在我有Failed to load properties file for project 'droid-platform'
错误。会话数据:
eclipse.buildId=M20100211-1343
java.version=1.5.0_18
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=ru_UA
Command-line arguments: -os linux -ws gtk -arch x86
Does anyone know, how do I deal with this?
有谁知道,我该如何处理?
采纳答案by folone
ADT does not work good with the platform itself. Actually, the platform is not an android project itself.
ADT 不适用于平台本身。实际上,该平台本身并不是一个 android 项目。
回答by Chocolate lover
Use the contextual menu on the Project in error, "Android Tools"-->"Fix project properties", I also tried "Refresh (F5)" in the same pass, than it worked again.
错误地使用项目上的上下文菜单,“Android 工具”-->“修复项目属性”,我还尝试了“刷新(F5)”,然后再次运行。
回答by Yusufk
I really struggled with this one and finally solved it using the solution here: "Debug certificate expired" error in Eclipse Android plugins
我真的很纠结这个问题,最后使用这里的解决方案解决了它: Eclipse Android 插件中的“调试证书过期”错误
I also had the error message you mention, but somehow, deleting the keystore fixed everything.
我也收到了您提到的错误消息,但不知何故,删除密钥库修复了所有问题。
p.s. do a clean after deleting the keystore.
ps 删除密钥库后进行清理。
Yusuf
优素福
回答by Andrew
The solution to this problem is to setup some System Environment Variables.
解决这个问题的方法是设置一些系统环境变量。
Right click on "My Computer" and select "Properties"
Select the "Advanced" tab
Click the "Environment Variables" button
Under "System Variables" find "Path", select is and then click "edit"
Scroll to the far right, now you need to add two paths, "C:\Documents and Settings\YOUR_USER_NAME\.android\avd" and "C:\Program Files\Java\jdk1.7.0_01\bin", you need to add a ; at the end of each path. Click "Ok" when done.
Select the "New" button, for variable name enter "ANDROID_SDK_HOME", and for variable value enter your SDK install path (Default is "C:\Program Files\Android\android-sdk") and then click "Ok"
Restart Eclipse and it should work!
右键单击“我的电脑”并选择“属性”
选择“高级”选项卡
单击“环境变量”按钮
在“系统变量”下找到“路径”,选择是,然后单击“编辑”
滚动到最右边,现在需要添加两个路径,“C:\Documents and Settings\YOUR_USER_NAME\.android\avd”和“C:\Program Files\Java\jdk1.7.0_01\bin”,你需要添加一个; 在每条路径的尽头。完成后单击“确定”。
选择“新建”按钮,变量名输入“ANDROID_SDK_HOME”,变量值输入你的SDK安装路径(默认为“C:\Program Files\Android\android-sdk”),然后点击“确定”
重新启动 Eclipse,它应该可以工作了!
回答by sasuri
So easy just choose the project that has an error, and then go to menu>project>build Project
如此简单,只需选择有错误的项目,然后转到菜单>项目>构建项目
回答by brainyideas
on my mac, with Eclipse and the Android AVD exited,
在我的 Mac 上,Eclipse 和 Android AVD 退出,
1) i deleted all projects in my workspace (backup first!),
1)我删除了工作区中的所有项目(先备份!),
2) recreated it with the same workspace name and
2)使用相同的工作区名称重新创建它,并且
3) finally restarted eclipse and a new project setup works fine without the "Failed to load properties.." msg.
3) 最终重新启动 eclipse 并且新的项目设置工作正常,没有“无法加载属性..”味精。
回答by John Oleynik
Just create a new file called project.properties in the root of your project.
只需在项目的根目录中创建一个名为 project.properties 的新文件。
Add the line:
添加行:
target=android-10
Or modify it to whatever version of the Android you're targeting.
或者将其修改为您所针对的任何 Android 版本。
回答by Fuzzy Analysis
I got the a similar error When following the Notepad tutorial on the Android Developers website, the first step in Exercise 1 is to create the first project by going to
我得到了一个类似的错误当遵循Android 开发者网站上的记事本教程时,练习 1 中的第一步是通过转到创建第一个项目
File->New->Android Project-> "Create project from existing source"
文件->新建->Android项目->“从现有源创建项目”
The problem is that when you select the Notepadv1 path to create the project from existing source, Eclipse will take the project out of the parent folder and move it up a level. For example, if you select
问题在于,当您选择 Notepadv1 路径从现有源创建项目时,Eclipse 会将项目从父文件夹中取出并将其向上移动一个级别。例如,如果您选择
C:\workspace\NotepadCodeLab\Notepadv1
C:\workspace\NotepadCodeLab\Notepadv1
... as the existing source, Eclipse will copy all the contents of that subfolder exceptthe AndroidManifest.xml (and Android.mk file) into a new folder one level up, eg.
...作为现有的源,Eclipse 会将该子文件夹中除AndroidManifest.xml(和 Android.mk 文件)之外的所有内容复制到上一级的新文件夹中,例如。
C:\workspace\Notepadv1
C:\工作区\记事本v1
So one workaround is to create the project, close Eclipse, then copy in all the missing files from the old subfolder to the new folder, then open Eclipse again and refresh the folder.
因此,一种解决方法是创建项目,关闭 Eclipse,然后将所有丢失的文件从旧子文件夹复制到新文件夹,然后再次打开 Eclipse 并刷新文件夹。
Presto, no more missing files.
Presto,不再丢失文件。
回答by CONvid19
In my case, I just add to import the R.java
(ex:import com.exercise.teste.R;
) to my class files by right clicking on ex: R.id.mybutton
and choose import ex; your.package.name.R
, then CLEAN
, BUILD
.
就我而言,我只是通过右键单击 ex:并选择 import ex;将R.java
(ex: import com.exercise.teste.R;
) 添加到我的类文件中R.id.mybutton
。your.package.name.R
, 那么CLEAN
, BUILD
.
回答by ben kiff
What fixed the problem for me was going into eclipse sdk manager and installing the tools there even though I had them installed on my sdk manager. It seems that there 2 separate sdk managers with different files, so try directly going into the sdk manager in Eclipse and seeing if you have the tools installed there.
为我解决问题的是进入 eclipse sdk 管理器并在那里安装工具,即使我将它们安装在我的 sdk 管理器上。似乎有 2 个单独的 sdk 管理器具有不同的文件,因此尝试直接进入 Eclipse 中的 sdk 管理器,看看您是否在那里安装了工具。