Project has no default.properties file! Edit the project properties to set one
While configuring MJAndriod I have got an error as follows:
Project has no default.properties file! Edit the project properties to set one.
I have a default.properties
开发者_开发百科which us set to a perfect target and works for another application in the same workspace.
Kindly help me resolve this.
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.
A note with the above discussion:
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
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.
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.
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 ;)
Don't import it into Eclipse, use create new project from existing source in Eclipse.
See project.properties in android project. In ADT 14, default.properties was renamed to project.properties.
Quote from the changelog:
default.properties which is the main project’s properties file containing information such as the build platform target and the library dependencies has been renamed project.properties.
*Note: Per the above link, if you don't have a default.properties file, likely you should upgrade your tools.
See build changes in revision 14, at the bottom under "Project Setup"
When i imported a project from another pc into my workspace, there was the default.properties but no R.java. Editing the default.properties didnt generate R.java. I changed the skd version from 1.1 to 1.5 and the R.java file was generated and the project worked.
First Close your project.
Open a Text File then Add target=android-your_Api_Level
.
Such as: target=android-7
And then Save that file as project.properties
Then manually place project.properties file into your Project's Folder and then Reopen you project.
The file generally looks like:
# 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 use,
# "ant.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-7
Just try these steps and i am sure it will definitely help you..
1.Just rename the project.properties to default.properties.
2.Delete your project from eclipse.
3.Again import your project into the eclipse.
Now the problem must be solve.
Please dont forget to give +1.
I got the default.properties error because the Android SDK wasn't installed on the machine I was using. What happened in my case was that I was setting up a second machine to development on.
After installing the SDK, the project imported just fine. You don't have to do New Project.
"default.properties" is renamed as "project.properties". You can reach "Package Explorer" -> "MyXXXXXApp" -> "project.properties"
Project has no default.properties file! Edit the project properties to set one
best option is create new workspace import the project ,fix the project its work
Right click on project --> properties --> Android.
Change the checkbox for project build target.
Press apply.
Change it back to your original build target.
Press apply --> ok
Worked for me
I have nothing to do something special.Only Open the debug.properties file edit target=android-APILEVEl.Like suppose it is default target=android-8 you can edit it target=android-4.Then build the project.Again edit target=android-8.Again edit it.Now you can see there have no error in your project.
In my case, it was because I was moving a project from Eclipse 7.1 to an older install of 7.0 on a different computer. You may want to check your eclipse versions.
In my case the file probably got deleted somehow. I just went to the SVN repository and reverted to the file.
Yet another solution as my own reminder; I got this error with FacebookSDK, importing project fails to build because it doesn't have default.properties, it has project.properties.
- Create empty default.properties (right click -> new, file)
- Edit project properties, select android, check correct SDK version, hit ok
- Clean projects
import -> Existing Android Code Into Workspace should solve the problem.
When importing to Eclipse project, I accidentally did:
BAD: Import...
>> General
>> Existing Proejcts into Workspace
when I should have done instead:
GOOD: Import...
>> Android
>> Existing Android Code Into Workspace
Removing the project imported with first method, and then re-importing it with the second method solved the problem for me.
(Others have written similar answers but I didn't get it until the explicit comparison.)
For me this problem occurred because I develop in two different environments with the same files. The newer environment converts the file structure and works fine then when I go back to the old environment I get this error. After messing around for a while trying to figure this out here is the solution I use:
1) rename project.properties to default.properties
2) edit .classpath file to remove the line:
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
4) Restart eclipse and/or clean the projects (may not be necessary)
`# 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 use,
# "ant.properties", and override values to adapt the script to your
# project structure.
# Project target.
**target=android-7`**
Change the target and save the file. Worked for me.
In my case I went to My Project
then to > Properties > Android >
and checked Google API box. Clicking 'Okay' caused it to then work for me.
May be you are missing Third party library
to like actionBarSherlock, slidingMenu, achartengine
Add it into lib
folder and Add to Build Path
..
Its work for me.
I solved this problem by adding appcompatv7 library to my project, though I don't require this library(as I my project don't target lower versions) I don't know why I had to add this. Hope someone else can solve their problem by adding same.
File-> Switch workspace -> newWorkSpace will solve the issue dx.jar
精彩评论