project.properties is being updated incorrectly when importing an Existing Android project into Eclipse. This file exists in source control:
# 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=Google Inc.:Google APIs:14
After importing the project (and doing NOTHING else) the file looks like this:
# 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-8
The manifest has the following items:
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="14"/>
This means that every time someone imports the project we're having to reset the build target in the project->properties->android menu. I have the latest ADT tools installed and all SDKs are downloaded and available.
Things I've tried:
I just verified that I can "fix" the project after it's imported. Delete the project from Eclipse but leaving the contents on disk. Importing the project incorrectly edits project.properties again. The import process does not recognize the Google APIs entries in project.properties.
This is how I'm getting the project from the file system into Eclipse:
Thoughts?
For now use General -> Existing Projects into Workspace instead of the Android -> Existing Android Code into Workspace to avoid the project.properties file being auto generated improperly.
You are correct, if your android project does not have a .classpath, the android package structure is lost. But if your android project is already an Eclipse project it should import just fine.
This is a bug in eclipse. http://code.google.com/p/android/issues/detail?id=40161
This excerpt explains the problem.
"If you are importing an Eclipse project (which has a .classpath), just use the generic Eclipse project import mechanism; that's still there (Import > General > Existing Projects Into Workspace). We added Import > Android > Existing Android Code Into Workspace because a lot of people had non-Eclipse projects to import, which was not well supported; you had to "Create New" and then use a checkbox to select "existing code" etc, and the location of the project and the location of the existing sources was ambiguous. We made the Existing Android Code import option also work for Eclipse projects, such that it would be a single obvious way to pull in source code. But this is new code, not the general Eclipse builtin import code, which is why it doesn't pick up the project name in the way it used to. (The related code which handled adding new project from source did act in the same quirky way the code does now, picking a project name from the manifest). However, making it look up the project name from the .project file as a better default, if present, should be doable so I'll try to add that as well."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With