Manually Fixing Android Eclipse Projects

SneWs's picture

I've spent a couple of hours migrating from IntelliJ to Eclipse and the bad part is that IntelliJ's Eclipse support plugin sucks if you want to export Android projects.

So after some googling around I came up with the following solution, manually editing the project files.

Take notice of the different buildSpec's as well as the natures defined. Eclipse does not have a UI to edit and add natures so this is a good way of rescuing a project file or just update a project to support Android builds.

A correct Eclipse .project file for Android should look something like this.

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
	<name>PROJECT_NAME</name>
	<comment></comment>
	<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>
	<natures>
		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
		<nature>org.eclipse.jdt.core.javanature</nature>
	</natures>
</projectDescription>

Post new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
© 2008 - 2012 Marcus Grenängen. Drupal theme by Kiwi Themes.