项目没有default.properties文件!编辑项目属性来设立一个项目、属性、编辑、文件

2023-09-12 23:37:24 作者:岁月的吻痕

在配置MJAndriod我已经得到了一个错误如下:

While configuring MJAndriod I have got an error as follows:

Project has no default.properties file! Edit the project properties to set one.

我有一个 default.properties 其中我们设置为一个完美的目标,工作在同一个工作区的另一个应用程序。

I have a default.properties which us set to a perfect target and works for another application in the same workspace.

请帮我解决这个问题。

推荐答案

如果该项目已经包含一个文件default.properties您可以打开该文件并编辑+保存(添加一个空格,保存,删除空间,节省) 。这为我工作。

If the project already contains a file default.properties you can open that file and edit+save it (add a space, save, remove that space, save). That worked for me.

与上述讨论的说明:

R.java是越来越通过执行上述过程中自动生成的。当我去删除它,它就会重新生成。无论是它让我编辑的自动生成的。 - Compuser7

R.java is getting generated automatically by doing the above described process. When I go and remove it, it gets generated again. Neither is it allowing me to edited the automatically generated one. – Compuser7

对于上面引述的评论,R.java的确是包含了属于你的项目中引用的所有资源(在res文件)自动生成的类。

With respect to the comment quoted above, R.java is indeed an automatically generated class that contains references to all the resources (in the res folder) that belong with your project.

在Eclipse的重建,这个文件重新生成,因为大多数的应用程序(我的意思是Java的code)依赖于一个事实,即有一些可用资源(图片,布局和字符串值)。当你通过Eclipse中删除该文件R.java,Eclipse会看到这样的变化,该项目为理由,要求自动重建(请参见项目下的选项)的项目,重新生成R.java文件。

When Eclipse rebuilds, this file is regenerated, since most application (I mean Java code) rely on the fact that there are some resources (images, layouts and string values) available. When you remove the file R.java through Eclipse, Eclipse will see this change in the project as a reason to automatically rebuild (see the options under Project) the project, regenerating the R.java file.

所以,不要试图删除R.java,因为Eclipse将尽快重新创造它为你重建项目,这将导致一个有耐心的比赛;)

So DON'T try to remove R.java, because Eclipse will regenerate it as soon as you rebuild the project, which will result in a match of patience ;)