Tuesday, May 29, 2012

How to convert and Java project to Android Library project ?

Today, I had to add  reference to a Java project. So I right clicked on the project and checked Properties but there was no "Android" in the treeview in the properties. How to fix this ?

1. Right click and close the project.
2. Open the .project file in notepad.
3. Search for <natures> </natures> tag and change to

<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
4. Save the file and open again in Eclipse.
5. Now you need to create "project.properties" and "AndroidManifest.xml" manually. (I just copied these two files from another project :D)
6. Right click on the project -> Android Tools -> Fix project properties.

After that when I right click and go to properties I can see "Android" in the listview :)



No comments:

Post a Comment