Possibility of relocating AndroidManifest.xml support for ADT plugin in Eclipse

1.3k views Asked by At

I'm attempting to develop an Android application using the following:

Eclipse Luna 4.4.0 Latest ADT plugin (https://dl-ssl.google.com/android/eclipse/) Maven + android-maven-plugin 4.0.0-rc.2

in Eclipse IDE, everything works fine if the AndroidManifest.xml and res folder is located in the root of the android project. However, if these two are NOT located in the root of the android project, an error will show stating those files are missing.

is there a way, in ADT plugin to configure the location of AndroidManifest.xml and res folder? Basically, I want to move it to src/main directory.

Reason being, is because the android-maven-plugin ver 4.x requires that AndroidManifest.xml and res folder should be in src/main directory or else it wont build. is there a way also in android-maven-plugin 4.x++ to configure the location of AndroidManifest.xml and res folder?

2

There are 2 answers

4
xtrycatchx On BEST ANSWER

I found the answer.

Just in case somebody encounters the same concern, the solution actually is just a configuration in android-maven-plugin for <resourceDirectory/> and <androidManifestFile/>. Something like this:

<plugin>
  <groupId>com.simpligility.maven.plugins</groupId>
  <artifactId>android-maven-plugin</artifactId>
  <version>${android-plugin-version}</version>
  <extensions>true</extensions>
    <configuration>
      <sign><debug>both</debug></sign>
      <resourceDirectory>${basedir}/res</resourceDirectory>
      <androidManifestFile>${basedir}/AndroidManifest.xml</androidManifestFile>
    </configuration>
 </plugin>
0
Caner On

If you have folder structure in the old way, you can tell maven where to look. This is what worked for me(details here):

<plugin>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>...</version>
<extensions>true</extensions>
    <configuration>
        ...
        <resourceDirectory>${project.basedir}/res</resourceDirectory>
        <androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
        <assetsDirectory>${project.basedir}/assets</assetsDirectory> 
        <genDirectory>${project.basedir}/gen</genDirectory>
        <nativeLibrariesDirectory>${project.basedir}/lib</nativeLibrariesDirectory>
    </configuration>
</plugin>