Eclipse: converting Android to plain Java project

When you are switching between Android and plain Java projects (or libraries) occasionally you may end up with a Java project that is complaining: AndroidManifest.xml is missing!
This tutorial shows the steps to fix that.



Step 1) Open .properties and remove line with AndroidNature


<natures><nature>com.android.ide.eclipse.adt.AndroidNature</nature><nature>org.eclipse.jdt.core.javanature</nature></natures>




Step 2) remove Android specific buildSpec

<buildSpec><buildCommand><name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name><arguments></arguments></buildCommand><buildCommand><name>com.android.ide.eclipse.adt.PreCompilerBuilder</name><arguments></arguments></buildCommand><buildCommand><name>org.eclipse.jdt.core.javabuilder</name><arguments></arguments></buildCommand><buildCommand><name>com.android.ide.eclipse.adt.ApkBuilder</name><arguments></arguments></buildCommand></buildSpec>



Step 3) Open .classpath and remove android references


<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>


Step 3) Open  project.properties (auto-generated) and remove Android references



android.library=true
# Project target.
target=android-17

Step 4)  Open .settings/org.eclipse.jdk.core.pref the file should look like that


eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

Step 4) Clean and rebuild the project






As an Amazon Associate I earn from qualifying purchases.

My favorite quotations..


“A man should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.”  by Robert A. Heinlein

"We are but habits and memories we chose to carry along." ~ Uki D. Lucas


Popular Recent Articles