javaandroideclipsemavenandroid-maven-plugin

Android project build with native libraries inside using maven


I have an Android project with Maven that uses internal libraries. When I run a maven install the so library is not inside the jar file generated and in consequence is not inside the apk generated. I'm using Eclipse with maven and android maven plugin v.3.7.0.

My pom.xml is:

    <build>
    <sourceDirectory>src</sourceDirectory>
    <finalName>../bin/${project.artifactId}</finalName>
    <plugins>
        <plugin>
            <groupId>com.jayway.maven.plugins.android.generation2</groupId>
            <artifactId>android-maven-plugin</artifactId>
            <version>3.7.0</version>
            <configuration>
                <nativeLibrariesDirectory>${project.basedir}/libs</nativeLibrariesDirectory>
                <sdk>
                    <path>${env.ANDROID_HOME}</path>
                    <platform>15</platform>
                </sdk>
            </configuration>
            <extensions>true</extensions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
    </plugins>
</build>

It seems that nativeLibrariesDirectory tag doesn't works for me.

Any idea to fix this problem? Thanks


Solution

  • The Android for Maven Eclipse project doesn't yet support native libraries. If you'd like to see this supported please send a pull request.