Project has no project.properties file

2019-02-06 06:01发布

I am developing Android app in Eclipse.

Currently, eclipse complains:

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

But I do have project.properties file under my project root folder. Why it complains?

This problem causes several of the resources in R.java can not be resolved in Activity. How to get rid of this problem?

11条回答
太酷不给撩
2楼-- · 2019-02-06 06:09

properties->Android lint preferences -> ignore all ->make a clean and build -> properties->Android lint prefrences -> include all

查看更多
霸刀☆藐视天下
3楼-- · 2019-02-06 06:11

Right click project -> Properties -> Java Build path -> Order and Export -> check the checkbox of Andorid 4.3.

查看更多
叼着烟拽天下
4楼-- · 2019-02-06 06:12

The accepted answer may had the problem solved a few years ago but it doesn't work anymore with the more recent tools.

This is a known bug on Eclipse.

The only way to solve this problem is by creating again a project.properties file, which no one posted how it looks inside so I'll be posting this as an answer:

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-19

Please note: set the correct target API for your project.

查看更多
兄弟一词,经得起流年.
5楼-- · 2019-02-06 06:14

If it happens after importing from archive, I suggest to remove the project for the workspace and import it again. That was working for me.

查看更多
走好不送
6楼-- · 2019-02-06 06:15

In case, you are importing new project from file folder, import this project as general project, not as Android project (I can not tell you why). After import, edit project.properties file, just add some character, then save the file. Now Eclipse recognizes project.properties file. Repair it(remove added character) and now the project should work fine.

查看更多
迷人小祖宗
7楼-- · 2019-02-06 06:17

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.

查看更多
登录 后发表回答