This error bothered me quite a bit too. All the steps described in other posts didnt work for me. But I found the solution and I hope it will help others.
In your project home, Eclipse will create a .classpath
file. Open it in an editor, and ensure that each of the following lines exist in it.
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Note that there will be other lines relevant to your project like
<classpathentry combineaccessrules="false" kind="src" path="/project-name"/>
that is okay, the key thing is this line is:
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
It needs to be in there. Make this change and save the file, and restart Eclipse. In main menu, do Project -> Clean. Now in project explorer, on the new project you just created, Right Click -> Properties -> Android -> Check Android 1.5 -> Click Apply Button.
Next project, Right Click -> Properties. In the menu on left, click on Java Build Path, on right panel, click on Libraries tab. Ensure that you see a folder called "Android 1.5". Now hit OK and your project should compile.
In the Library tab, if you see Android.jar then it must be deleted manually (highlight and click "Remove" button) and then this error will be gone.