8

I've downloaded one of the open source Android Applications (the music application) from the Android git, and I'm trying to create a new project from the source. Creating a new project using that existing source doesn't work giving me an "invalid description error". Any help?

3 Answers 3

15

You must be referring to the error message "invalid project description".

See this thread (relevant extracts below, with emphasis mine):

If you see a .project in the application you downloaded, you can try a "File" + "Import" + "Existing Projects into Workspace" and select the directory of the music sample.

But if not, using New> Android Project> Create project from existing source is the right way to do it.
Make sure to select which Android target you want (1.1 or 1.5 or 2.0):
the "new project" wizard will automatically select the right sample directory for you.
Then select "Browse" and the Music directory. It should then fill the properties at the bottom of the new android project wizard.

However you should not put your workspace in %ANDROID_HOME%\samples.
Leave it somewhere else (My Documents, whatever).
I suspect you get a conflict because Eclipse tries to create a project and there's already a directory of the same name.
In either case, can you look at your_workspace_dir/.metadata/.log for a more verbose error and post it?

In short:

  • Change the workspace other than android SDK.
  • Then dont put project name first.
  • Browse the project of \samples\Music in create project from the source.
  • The other fields will fill automaticaly.
  • Then execute....

See also this tutorial (for the Snake sample)

I wanted to open up the Snake sample provided in the SDK samples.
For this, choose ‘Create project from existing source’ in the New Android Project window and select the Snake directory from Samples.
This will set the package name, activity name, and application name for you.

http://www.infinitezest.com/images/eclipse-android-snake-project.jpg


That being said, if after importing the project, you end up (like the OP) with tons of errors.
See question R cannot be resolved - android error:

  • make sure the tools in the SDK directory have the permission to be executed
  • go to Project > Build all (and selecting "Build Automatically"

R is an automatically generated class that holds the constants used to identify your resources.


Other cause for massive compilation errors all over the Eclipse Android project, as reported by the OP himself (GuyNoir):

The code I downloaded from git was the newest version, and probably for Android 2.1, where the SDK I'm was creating it under was Android 1.5.
So I'll need to download older code or install the latest SDK.

Sign up to request clarification or add additional context in comments.

7 Comments

That fixed the error. But when the project is created there are hundreds of errors related to not being able to find resources. Is there a specific way/tutorial for importing the Git android applications (not the samples).
@GuyNoir : having some of the errors would help. Did you set the Android JDK location before importing the application?
I'm not exactly sure what you mean by that. Here's what the project looks like when it's imported. My other applications work fine, it's just this one. img163.imageshack.us/img163/7517/ss20100206140200.png Here's one of the .java files: img163.imageshack.us/img163/4048/ss20100206140337.png
@GuyNoir: "R cannot be resolved", right: see stackoverflow.com/questions/885009/…. That should solve that problem.
|
3

I was still getting the "invalid project description" error with the Android 2.3 SDK examples (Eclipse Helios 20100917-0705, Ubuntu 10.10). It won't import the existing projects.

WORKAROUND:

  • Place the project in a owned directory (I copied them from my SDK install at /opt/anrdroid-sdk-linux_86) to my ~/workspace directory.
  • Using the Java Package Explorer view /New/JavaProject, enter the project directory name (you should see the existing files on the 2nd wizard page)
  • In Package Manager, select the new project: Android Tools/Convert to Android Project
  • Create the /gen project directory if it doesn't exist (fails without it)
  • Android Tools/Fix Project Properties
  • Main Menu/Project/Build Project

I've had good luck getting the example Apps to compile and run this way

1 Comment

Since we have project files ignored for git, this is the solution I had to use. Thanks.
1

Resources should realign with what you imported it often takes the ADT eclipse plugin some time ro recognize sometimes depending upon size of the project

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.