missing project.properties file error - android

I'm new to Android development. As I'm learning, I've used a few of the sample projects provided with the Android SDK. I have already had the ApiDemos running on the emulator, but when I went to run it today (now yesterday) I have these 3 errors.
Description
(1) Project has no project.properties file! Edit the project properties to set one.
(2) The project was not built since its build path is incomplete. Cannot find the class >file for java.lang.Object. Fix the build path then try building this project
(3) The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
I have looked in the ApiDemos project folder in my workspace for the project.properties file and it does exist.
Here's what I've tried multiple times...
-fix project properties
-clean the project
-delete the project and re-create it
Please forgive if this seems too simple. I hope it is a simple problem. I'm just overwhelmed by the Eclipse IDE, so maybe your answer could help me understand it better. Thanks in advance.

Please check if you have something like
sdk.dir=/Developer/AndroidSDK
in your local.properties file.
Also, by default project.properties file is pretty simple:
# Project target.
target=android-15

From the context menu on the Android Java project, please use Android Tools->Fix Project Properties.
If that does not help, you can change the settings in the file using a nice dialog by using the context menu again, this time selecting Properties->Android.

If you're using Android Studio you might have noticed that it doesn't create the project.properties file anymore.
But sometimes it's needed, especially with CI servers like Jenkins.
In that case you can add it running this command in the project's folder:
android update project --path ./src/main/ --target android-19
Where android-19 is the target you specified in your build.gradle file and src/main is the default path for AndroidManifest.xml

Related

Project has no project.properties file When creating a new Android Project

I just installed Eclipse on my Mac, I downloaded the bundle that provides Eclipse+SDK, I've also downloaded all the needed updates but when I create a new project I get the following error:
[2014-08-25 16:51:02 - provaApp] Project has no project.properties
file! Edit the project properties to set one.
I've tried everything found here on SO but none of the answers worked, I really have no idea on how to fix this. I've also deleted and downloaded Eclipse twice.
Edit: I get also the following error if I try to edit the properties of the Project by right-clicking on Project Root folder > properties > Android
If I try to set the project build target (in my case Android 4.4W) I can't because it doesn't save the changes.
What I know works is if you create a new blank project, copy that project.properties file into the existing project and it should work. Also try running a clean project sometimes helps, but very rarely.
It's a pain but luckily this happens rarely.
Try to create a project.properties file with this content:
target=android-19

R.java not being generated for new Android project

When I create a new android project in Eclipse, and I choose to have a default main activity, my R.java file does not get generated.
I have seen some questions online and on this site about R.java not being generated but all are due to some manual action/mistake that had to be corrected during the development of the application.
However, does anyone know why R.java would not get generated for a brand new android project, where I have made no manual modifications whatsoever?
I think your problem is just the latest update of the SDK.
Test the following operations on two projects :
In the project properties (eclipse) -> java build path -> order and export make sure that all your jars in the libs folder are checked.
And "Android Tools -> Fix Project Properties"
And "Project -> Clean"
I hope you have helped!
ADT version 22 requires that you install "build tools". To get it to work i had to update:
SDK Tools
Platform Tools
Then install:
Build Tools
This link recommends you add build tools to your environment path. I had to do the following before the R.java was generated:
Append build tools to PATH environment variable
Restart Eclipse.
Make sure your project is free of errors and problems. You can use Windows-View to find and rectify them. Common mistakes are in the layout files.
Check the AndroidManifest file and see if the activity names match the classes in your source folder. Clean and rebuild.
R.java creates every time when you create android project first time r.java created by default
so check for the errors and clean the project.

library resolve to a path with no project.properties file

I'm having trouble building my project with Jenkins and referencing the Sherlock project library.
I can build the project with ant on my local system. The problem seems to be referencing the Sherlock library on the build server.
I pass an environment variable to ant with the relative path to the Sherlock library project:
android.library.reference.1=../../buildlibraries/androidlibraries/sherlock/library
I'm getting this error.
**BUILD FAILED**
/SDK/android-sdk-macosx/tools/ant/build.xml:595:
The following error occurred while executing this line:
/SDK/android-sdk-macosx/tools/ant/build.xml:571:
../../buildlibraries/androidlibraries/sherlock/library resolve to a path with
no project.properties file for project /Users/Jenkins/buildlibraries/androidlibraries/sherlock/library
I checked and a project.properties file does exist at that location.
It has these properties:
android.library=true
# Project target.
target=android-14
I had the same thing happen to me just now. I use both a Windows and Mac to develop with. I watne d to test my project on both platforms. It built just fine on my Windows machine, but broke on my Mac. When I looked at my project.properties in my Android application (not library projects) on the Mac, I saw that my library projects were referenced this way:
android.library.reference.1=LibraryProjects\\my_lib_project
I changed it to the line below, and it worked just fine!
android.library.reference.1=LibraryProjects/my_lib_project
I solved the issue by editing and checking in the project.properties file with the same property: android.library.reference.1=../../buildlibraries/androidlibraries/sherlock/library
I'm not sure why it works. Why would ant care if the property is passed in by Jenkins vs. declared in the project's property file?
Now I have two paths in my project.properties file: one for a local build and one for the build on Jenkins.
I had similar issue with error ../google-play-services_lib resolve to a path with no project.properties file for project. It has to work in Jenkins CI (Cloudbees), so no manual project.properties editing.
My solution was to replace android update lib-project --path ... with ugly but working echo "android.library.reference.1=../../../..$ANDROID_HOME/extras/google/google_play_services/libproject/google-play-services_lib" >> project.properties in Jenkins shell command.
I had this problem because I hadn't downloaded the google play services package using the android tool. When I checked my android sdk directory ($ANDROID_HOME) there was no "$ANDROID_HOME/extras/google" folder.
I fixed this by running android and downloading "Google Play services" found in the extras section.

Android Development Issues in Eclipse

i am trying to build an android application in eclipse. My issue in detail is as follows:
I first setup the sdk and adt plugin along with the svn for eclipse.
Then I imported an existing svn trunk from (File->Import->Checkout projects from SVN).
Then I face the following errors:
a. Project has no default.properties file! Edit the project properties to set one.
b. None of import files are being resolved. It includes java.io, and all the basic java classes. I checked the Compiler Compliance level too.. It is set to 1.6
c. When I check into project properties for the issue, under Java Build Path: I find "Build path is entry missing: Projectname/gen"
Then in the libraries tab i find: "Unable to get System Library for the project".
It would be really nice if some one can throw some light on this issue. plz let me know if u need any more description.
Thanks,
Maverick gugu
Did you check out .classpath and .project files from svn to? My usual scenario is to checkout files from version control and then Create New Project->Android-> Create from existing sources.Usually it works OK.

Problem importing Android project archives into Eclipse

My apologies if this is a stupid newbie question...
I'm using Eclipse (Helios release) and have the Android SDK all configured as per the developer.android.com recommendations. I can create and run new projects without any problem but I can't import archived project code samples (found on the web etc.) using Import > Existing Projects Into Workspace.
Importing a zip creates a project but it doesn't create it as an Android project and the console displays the error: "Project has no default.properties file! Edit the project properties to set one."
I've tried going into the project Properties but as soon as I click on 'Android' in the properties tree a pop-up appears saying "Could Not Accept Changes: The currently displayed page contains invalid values"
See: http://screencast.com/t/ZmY3ZWQ4
But if I do this on one of my own projects I have no such error, and I'm able to change things such as the Android Platform/API level. I'm also able to archive my own projects (using export) and import them again without any problems... nut not other people's archives! Am I being really stupid?
Any help would be really appreciated!
All the baseline default.properties needs is a line like:
target=android-8
You can most likely copy another projects' default.properties into this project. A (not-so-)quick restart of Eclipse, a rebuilding of the workspace, and you're off to the races.
It's really lame that this is needed -- it should happen as part of the import process, I would think.
just change your
project.properties file to default.properties
and restart your eclipse
it's done..
Right click on the project in navigator window, go to android tools and click on fix project properties. It might work, as it did for me ;-)
You can look at this section, it works for me:
Project has no default.properties file!
If you want to change the library of your project, do that :
- right click on the project name
- Build Path
- Configure build path
- click Android on the left, and select the library you need.
I had the same problem.
What you are trying is little difficult.Just unzip the files ,copy res and src folders
to ur existing project.The problem is the files starting with "." which have settings for their android and eclipse.
So you need to modify all that,so simply create new project or to ur existing one copy res, src and AndroidManifest.xml file.
It worked for me .
In the project right click Android Tools -> Fix Project Properties

Categories

Resources