Building Android app and run Robotium tests with Maven - android

I really need your help here. I want to set up Jenkins to build my Android app and run my Robotium tests on emulator using Maven. I think I did everything ok but still have same error. Have you ever had something like that? My project structure is below:
izi-mobiler.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>pl.araneo.farmadroid</groupId>
<artifactId>izi-mobiler</artifactId>
<version>366</version>
<packaging>pom</packaging>
<name>IZI</name>
<modules>
<module>izi-mobiler-app</module>
<module>izi-mobiler-test</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.0.1.2</version>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android-test</artifactId>
<version>4.0.1.2</version>
</dependency>
<dependency>
<groupId>com.pivotallabs</groupId>
<artifactId>robolectric</artifactId>
<version>1.2-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-lgpl</artifactId>
<version>1.7.1</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.9.0</version>
</dependency>
<dependency>
<groupId>org.roboguice</groupId>
<artifactId>roboguice</artifactId>
<version>2.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<version>3.0</version>
<exclusions>
<exclusion>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-assistedinject</artifactId>
<version>3.0</version>
<exclusions>
<exclusion>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>support-v4</artifactId>
<version>r7</version>
</dependency>
<!-- Action Bar sherlock -->
<dependency>
<groupId>com.actionbarsherlock</groupId>
<artifactId>library</artifactId>
<version>4.1.0</version>
<type>apklib</type>
</dependency>
<!-- Let Roboguice and Sherlock work together -->
<dependency>
<groupId>com.github.rtyley</groupId>
<artifactId>roboguice-sherlock</artifactId>
<version>1.4</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.0.0-alpha-13</version>
<extensions>true</extensions>
<configuration>
<sdk>
<platform>15</platform>
</sdk>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
izi-mobiler-app.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>pl.araneo.farmadroid</groupId>
<artifactId>izi-mobiler</artifactId>
<version>366</version>
<relativePath>../</relativePath>
</parent>
<groupId>pl.araneo.farmadroid</groupId>
<artifactId>izi-mobiler-app</artifactId>
<version>366</version>
<packaging>apk</packaging>
<name>IZI - App</name>
<properties>
<platform.version>4.0.1.2</platform.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.pivotallabs</groupId>
<artifactId>robolectric</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-lgpl</artifactId>
<version>1.7.1</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</dependency>
<dependency>
<groupId>org.roboguice</groupId>
<artifactId>roboguice</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<exclusions>
<exclusion>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-assistedinject</artifactId>
<exclusions>
<exclusion>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>support-v4</artifactId>
</dependency>
<!-- Action Bar sherlock -->
<dependency>
<groupId>com.actionbarsherlock</groupId>
<artifactId>library</artifactId>
<type>apklib</type>
</dependency>
<!-- Let Roboguice and Sherlock work together -->
<dependency>
<groupId>com.github.rtyley</groupId>
<artifactId>roboguice-sherlock</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.4.0</version>
<configuration>
<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
<assetsDirectory>${project.basedir}/assets</assetsDirectory>
<resourceDirectory>${project.basedir}/res</resourceDirectory>
<nativeLibrariesDirectory>${project.basedir}/src/main/native</nativeLibrariesDirectory>
<sdk>
<platform>15</platform>
</sdk>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
izi-mobiler-test.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>pl.araneo.farmadroid</groupId>
<artifactId>izi-mobiler</artifactId>
<version>366</version>
</parent>
<groupId>pl.araneo.farmadroid</groupId>
<artifactId>izi-mobiler-test</artifactId>
<packaging>apk</packaging>
<name>IZI - Test</name>
<dependencies>
<dependency>
<groupId>com.jayway.android.robotium</groupId>
<artifactId>robotium-solo</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android-test</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>support-v4</artifactId>
</dependency>
<dependency>
<groupId>com.actionbarsherlock</groupId>
<artifactId>library</artifactId>
<type>apklib</type>
</dependency>
<dependency>
<groupId>com.github.rtyley</groupId>
<artifactId>roboguice-sherlock</artifactId>
</dependency>
<dependency>
<groupId>pl.araneo.farmadroid</groupId>
<artifactId>izi-mobiler-app</artifactId>
<version>366</version>
<type>apk</type>
</dependency>
<dependency>
<groupId>pl.araneo.farmadroid</groupId>
<artifactId>izi-mobiler-app</artifactId>
<version>366</version>
<scope>compile</scope>
<type>jar</type>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
Stack Trace
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/piotrslesarew/git/izi-mobiler/izi-mobiler-test/src/main/java/pl/araneo/farmadroid/ui/activities/test/DashboardViewTest.java:[7,7] error: cannot access TestCase
[ERROR] class file for junit.framework.TestCase not found
/home/piotrslesarew/git/izi-mobiler/izi-mobiler-test/src/main/java/pl/araneo/farmadroid/ui/activities/test/DashboardViewTest.java:[17,24] error: cannot find symbol
[ERROR] class DashboardViewTest
/home/piotrslesarew/git/izi-mobiler/izi-mobiler-test/src/main/java/pl/araneo/farmadroid/ui/activities/test/DashboardViewTest.java:[17,46] error: cannot find symbol
[ERROR] class DashboardViewTest
/home/piotrslesarew/git/izi-mobiler/izi-mobiler-test/src/main/java/pl/araneo/farmadroid/ui/activities/test/DashboardViewTest.java:[15,4] error: method does not override or implement a method from a supertype
[INFO] 4 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] IZI ............................................... SUCCESS [0.183s]
[INFO] IZI - App ......................................... SUCCESS [36.895s]
[INFO] IZI - Test ........................................ FAILURE [3.741s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 41.924s
[INFO] Finished at: Sat Nov 17 16:40:51 CET 2012
[INFO] Final Memory: 35M/354M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project izi-mobiler-test: Compilation failure: Compilation failure:
[ERROR] /home/piotrslesarew/git/izi-mobiler/izi-mobiler-test/src/main/java/pl/araneo/farmadroid/ui/activities/test/DashboardViewTest.java:[7,7] error: cannot access TestCase
[ERROR] class file for junit.framework.TestCase not found
[ERROR] /home/piotrslesarew/git/izi-mobiler/izi-mobiler-test/src/main/java/pl/araneo/farmadroid/ui/activities/test/DashboardViewTest.java:[17,24] error: cannot find symbol
[ERROR] class DashboardViewTest
[ERROR] /home/piotrslesarew/git/izi-mobiler/izi-mobiler-test/src/main/java/pl/araneo/farmadroid/ui/activities/test/DashboardViewTest.java:[17,46] error: cannot find symbol
[ERROR] class DashboardViewTest
[ERROR] /home/piotrslesarew/git/izi-mobiler/izi-mobiler-test/src/main/java/pl/araneo/farmadroid/ui/activities/test/DashboardViewTest.java:[15,4] error: method does not override or implement a method from a supertype
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :izi-mobiler-test

Since Instrumentation Tests are in their own module and should be in the 'src/main/java' directory and not in the 'src/main/test' they appear to be compiled in a different lifecycle phase than tests usually are.
I eliminated this particular error in my project by setting the junit scope from test to compile for the test module:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>compile</scope>
</dependency>
(After that my tests fail to run on the emulator)

Related

Importing support library appcompat to Maven project

I converted my Android project into Maven project. I have support library called appcompat_v7, which I would like to add into my Maven dependencies.
I read that I should add dependencies to pom.xml
<dependency>
<groupId>android.support</groupId>
<artifactId>compatibility-v7-appcompat</artifactId>
<version>19.1.0</version>
<type>apklib</type>
</dependency>
<dependency>
<groupId>android.support</groupId>
<artifactId>compatibility-v7-appcompat</artifactId>
<version>19.1.0</version>
<type>jar</type>
</dependency>
Also built jar and apklib by running:
mvn install:install-file -Dfile="./com/android/support/appcompat-v7/19.1.0/appcompat-v7-19.1.0.aar"/ -DpomFile="./com/android/support/appcompat-v7/19.1.0/appcompat-v7-19.1.0.pom"/ -Dpackaging="apklib"
mvn install:install-file -Dfile="./com/android/support/appcompat-v7/19.1.0/appcompat-v7-19.1.0.jar"/ -DpomFile="./com/android/support/appcompat-v7/19.1.0/appcompat-v7-19.1.0.pom"/ -Dpackaging="jar"
My pom.xml is now following:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ProjectTest</groupId>
<artifactId>ProjectTest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>appcompat-v7</artifactId>
<version>19.1.0</version>
<type>apklib</type>
</dependency>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>appcompat-v7</artifactId>
<version>19.1.0</version>
<type>jar</type>
</dependency>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source/>
<target/>
</configuration>
</plugin>
</plugins>
</build>
</project>
I am still having error ''R cannot be resolved to a variable'' after I deleted support libraby appcompat_v7

getting error when tried to build app with maven

I am trying to build my app using maven. There are 3 projects in my app, 2 library projects and 1 main project. I am using 4.2.2 version of android.since there is no dependency available in maven repository for 4.2.2 version i have manually installed the android.jar file to my local repository. When i tried to build my project i am getting below error on main project. 2 library projects and parent pom files are building properly.
[ERROR] Error when generating sources.
org.apache.maven.plugin.MojoExecutionException:
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:478)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:193)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: com.jayway.maven.plugins.android.ExecutionException: ANDROID-040-001: Could not execute: Command = cmd.exe /X /C "D:\Android\android-sdk\platf
orm-tools\aapt.exe package -m -J D:\Development\Android\1.Projects\SAFE-0460-01-00\SafewayWorkspace\maven\3.2_rc\Safeway\target\generated-sources\r -M D:
\Development\Android\1.Projects\SAFE-0460-01- 00\SafewayWorkspace\maven\3.2_rc\Safeway\AndroidManifest.xml -S D:\Development\Android\1.Projects\SAFE-0460-
01-00\SafewayWorkspace\maven\3.2_rc\Safeway\res -S D:\Development\Android\1.Projects\SAFE-0460-01-00\SafewayWorkspace\maven\3.2_rc\Safeway\target\unpack\
apklibs/com.safeway.justforu_android-mapviewballoons_apklib_1.0.0-SNAPSHOT/res -S D:\Development\Android\1.Projects\SAFE-0460-01-00\SafewayWorkspace\mave
n\3.2_rc\Safeway\target\unpack\apklibs/com.safeway.justforu_AndroidClient_apklib_1.0.0-SNAPSHOT/res --auto-add-overlay -A D:\Development\Android\1.Projec
ts\SAFE-0460-01-00\SafewayWorkspace\maven\3.2_rc\Safeway\assets -I D:\Android\android-sdk\platforms\android-17\android.jar", Result = 1
at com.jayway.maven.plugins.android.CommandExecutor$Factory$1.executeCommand(CommandExecutor.j va:339)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:474)
... 22 more
This is my main project POM file.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.app.pack</groupId>
<artifactId>libraryprojects-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>com.app.pack</groupId>
<artifactId>MainProj</artifactId>
<packaging>apk</packaging>
<name>MainProj</name>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android.support-v4</groupId>
<artifactId>android-support-v4</artifactId>
<version>r6-googlemaps</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.amazon.maps</groupId>
<artifactId>maps</artifactId>
<version>1.0.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android.maps</groupId>
<artifactId>maps</artifactId>
<version>17_r1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.lib.proj1</groupId>
<artifactId>libproj1</artifactId>
<version>1.0.0-SNAPSHOT</version>
<type>apklib</type>
</dependency>
<dependency>
<groupId>com.lib.proj2</groupId>
<artifactId>libproj2</artifactId>
<version>1.0.0-SNAPSHOT</version>
<type>apklib</type>
</dependency>
<dependency>
<groupId>com.google.android.ensighten</groupId>
<artifactId>Ensighten</artifactId>
<version>1.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.google.android.ensighten</groupId>
<artifactId>EnsightenAspect</artifactId>
<version>1.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android-async-http</artifactId>
<version>1.4.3</version>
<type>jar</type>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
And this is my parent POM file
http://maven.apache.org/maven-v4_0_0.xsd">
4.0.0
com.app.pack
libraryprojects-parent
1.0.0-SNAPSHOT
pom
Library Projects Parent
com.google.android
android
4.2.2
com.google.android
android-test
4.1.1.4
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<sdk>
<platform>17</platform>
</sdk>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

How to import both ViewPagerIndicator and ActionBarSherlock?

If i only using ViewPagerIndicator as dependency project, then everything goes fine. But after i import ActionBarSherlock, something wrong happens.
Here is the output log:
125 || [INFO] ------------------------------------------------------------------------
126 || [INFO] BUILD FAILURE
127 || [INFO] ------------------------------------------------------------------------
128 || [INFO] Total time: 33.129s
129 || [INFO] Finished at: Thu Sep 19 14:33:23 CST 2013
130 || [INFO] Final Memory: 19M/102M
131 || [INFO] ------------------------------------------------------------------------
132 || [ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.2-SNAPSHOT:dex (default-dex) on project rms: MojoExecutionException: ANDROID-040-001: Could not execute: Command = /bin/sh -c cd /Users/ccheng/workspace/rms && /System/Library/Java/JavaVirtualMachines/1.6.0. jdk/Contents/Home/bin/java -Xmx1024M -jar /Users/ccheng/program/adt-bundle-mac-x86_64-20130219/sdk/build-tools/18.0.1/lib/dx.jar --dex --output=/Users/ccheng/ workspace/rms/target/classes.dex /Users/ccheng/.m2/repository/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar /Users/ccheng/.m2/repository/com/google/ code/gson/gson/2.2.4/gson-2.2.4.jar /Users/ccheng/.m2/repository/com/biubiubiu/indexablelistview-lib2/1.0.0-SNAPSHOT/indexablelistview-lib2-1.0.0-SNAPSHOT.apklib / Users/ccheng/.m2/repository/com/biubiubiu/indexablelistview-lib1/1.0.0-SNAPSHOT/indexablelistview-lib1-1.0.0-SNAPSHOT.apklib /Users/ccheng/.m2/repository/com/novoda/ imageloader/imageloader-core/1.5.8/imageloader-core-1.5.8.jar /Use
133 || rs/ccheng/.m2/repository/com/github/chrisbanes/pulltorefresh/library/2.1.1/library-2.1.1.apklib /Users/ccheng/workspace/rms/target/classes /Users/ccheng/.m2/ repository/com/tjerkw/slideexpandablelistview-library/1.1.0-SNAPSHOT/slideexpandablelistview-library-1.1.0-SNAPSHOT.apklib /Users/ccheng/.m2/repository/com/google/ android/support-v4/r7/support-v4-r7.jar /Users/ccheng/.m2/repository/msx/android/preferences/libraryprojects-lib1/1.0.0-SNAPSHOT/libraryprojects-lib1-1.0.0-SNAPSHOT. apklib /Users/ccheng/.m2/repository/com/actionbarsherlock/actionbarsherlock/4.3.1/actionbarsherlock-4.3.1.apklib /Users/ccheng/.m2/repository/com/meishixing/android- async-http/1.4.2/android-async-http-1.4.2.jar /Users/ccheng/.m2/repository/com/viewpagerindicator/library/2.4.1/library-2.4.1.apklib /Users/ccheng/.m2/repository/ android/support/compatibility-v4/18/compatibility-v4-18.jar, Result = 1 -> [Help 1]
134 || [ERROR]
135 || [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
136 || [ERROR] Re-run Maven using the -X switch to enable full debug logging.
137 || [ERROR]
138 || [ERROR] For more information about the errors and possible solutions, please read the following articles:
139 || [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
140 || make: *** [main] Error 1
➜ /tmp /bin/sh -c cd /Users/ccheng/workspace/rms && /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Xmx1024M -jar /Users/ccheng/program/adt-bundle-mac-x86_64-20130219/sdk/build-tools/18.0.1/lib/dx.jar --dex --output=/Users/ccheng/workspace/rms/target/classes.dex /Users/ccheng/.m2/repository/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar /Users/ccheng/.m2/repository/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar /Users/ccheng/.m2/repository/com/biubiubiu/indexablelistview-lib2/1.0.0-SNAPSHOT/indexablelistview-lib2-1.0.0-SNAPSHOT.apklib /Users/ccheng/.m2/repository/com/biubiubiu/indexablelistview-lib1/1.0.0-SNAPSHOT/indexablelistview-lib1-1.0.0-SNAPSHOT.apklib /Users/ccheng/.m2/repository/com/novoda/imageloader/imageloader-core/1.5.8/imageloader-core-1.5.8.jar /Users/ccheng/.m2/repository/com/github/chrisbanes/pulltorefresh/library/2.1.1/library-2.1.1.apklib /Users/ccheng/workspace/rms/target/classes /Users/ccheng/.m2/repository/com/tjerkw/slideexpandablelistview-library/1.1.0-SNAPSHOT/slideexpandablelistview-library-1.1.0-SNAPSHOT.apklib /Users/ccheng/.m2/repository/com/google/android/support-v4/r7/support-v4-r7.jar /Users/ccheng/.m2/repository/msx/android/preferences/libraryprojects-lib1/1.0.0-SNAPSHOT/libraryprojects-lib1-1.0.0-SNAPSHOT.apklib /Users/ccheng/.m2/repository/com/actionbarsherlock/actionbarsherlock/4.3.1/actionbarsherlock-4.3.1.apklib /Users/ccheng/.m2/repository/com/meishixing/android-async-http/1.4.2/android-async-http-1.4.2.jar /Users/ccheng/.m2/repository/com/viewpagerindicator/biubiubiu-library/2.4.1/biubiubiu-library-2.4.1.apklib /Users/ccheng/.m2/repository/android/support/compatibility-v4/18/compatibility-v4-18.jar
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/FragmentManagerState;
at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
at com.android.dx.command.dexer.Main.processClass(Main.java:490)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:459)
at com.android.dx.command.dexer.Main.access$400(Main.java:67)
at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:398)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
at com.android.dx.command.dexer.Main.processOne(Main.java:422)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:333)
at com.android.dx.command.dexer.Main.run(Main.java:209)
at com.android.dx.command.dexer.Main.main(Main.java:174)
at com.android.dx.command.Main.main(Main.java:91)
This is my pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>me.biubiubiu.rms</groupId>
<artifactId>rms</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>apk</packaging>
<name>rms</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<fest-assert.version>1.0.4</fest-assert.version>
<junit.version>4.10</junit.version>
<robolectric.version>2.0</robolectric.version>
<android.version>4.1.1.4</android.version>
<android-support.version>r13</android-support.version>
</properties>
<dependencies>
<dependency>
<groupId>android</groupId>
<artifactId>android</artifactId>
<version>4.2.2_r2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>android.support</groupId>
<artifactId>compatibility-v4</artifactId>
<version>18</version>
</dependency>
<dependency>
<groupId>com.tjerkw</groupId>
<artifactId>slideexpandablelistview-library</artifactId>
<version>1.1.0-SNAPSHOT</version>
<type>apklib</type>
</dependency>
<dependency>
<groupId>com.meishixing</groupId>
<artifactId>android-async-http</artifactId>
<version>1.4.2</version>
<type>jar</type>
</dependency>
<!--<dependency>-->
<!--<groupId>com.</groupId>-->
<!--<artifactId>biubiubiu-library</artifactId>-->
<!--<version>2.4.1</version>-->
<!--<type>apklib</type>-->
<!--</dependency>-->
<dependency>
<groupId>com.viewpagerindicator</groupId>
<artifactId>library</artifactId>
<version>2.4.1</version>
<type>apklib</type>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>com.github.chrisbanes.pulltorefresh</groupId>
<artifactId>library</artifactId>
<version>2.1.1</version>
<type>apklib</type>
</dependency>
<dependency>
<groupId>com.novoda.imageloader</groupId>
<artifactId>imageloader-core</artifactId>
<version>1.5.8</version>
</dependency>
<dependency>
<groupId>com.biubiubiu</groupId>
<artifactId>indexablelistview-lib2</artifactId>
<version>1.0.0-SNAPSHOT</version>
<type>apklib</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.squareup</groupId>
<artifactId>fest-android</artifactId>
<version>${fest-assert.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.robolectric</groupId>
<artifactId>robolectric</artifactId>
<version>${robolectric.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>msx.android.preferences</groupId>
<artifactId>libraryprojects-lib1</artifactId>
<version>1.0.0-SNAPSHOT</version>
<type>apklib</type>
</dependency>
<dependency>
<groupId>com.actionbarsherlock</groupId>
<artifactId>actionbarsherlock</artifactId>
<version>4.3.1</version>
<type>apklib</type>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.6.2-SNAPSHOT</version>
<configuration>
<sdk>
<platform>17</platform>
</sdk>
<manifest>
<debuggable>true</debuggable>
</manifest>
</configuration>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
<!--jarsign-->
<profiles>
<profile>
<id>sign</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jarsigner-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>signing</id>
<goals>
<goal>sign</goal>
</goals>
<phase>package</phase>
<inherited>true</inherited>
<configuration>
<archiveDirectory></archiveDirectory>
<includes>
<include>target/*.apk</include>
</includes>
<keystore>/Users/ccheng/workspace/msx-crazysight/meishixing.keystore</keystore>
<storepass>meishigo</storepass>
<keypass>meishigo</keypass>
<alias>meishixing</alias>
<arguments>
<argument>-sigalg</argument><argument>MD5withRSA</argument>
<argument>-digestalg</argument><argument>SHA1</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<sign>
<debug>false</debug>
</sign>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
if the problem is with ActionBarSherlock, try using ActionBarActivity which is available in v7 support library
I found this problem is caused by the v4 library i import is different from ActionBarSherlock.
After i change all the dependency project to
<dependency>
<groupId>android.support</groupId>
<artifactId>compatibility-v4</artifactId>
<version>18</version>
</dependency>
it works find again.

Maven dependency scope for robolectric either stops tests running or makes build run out of heap space

I have this Android project and some difficulty configuring the build with Maven & Robolectric. If I set the scope of the robolectric dependency to 'test', then the project builds fine, but the tests fail to run [wrong version of junit or java.lang.NoClassDefFoundError]. If I don't set the scope of the robolectric dependency, the tests run fine (and pass) but the build runs out of heap space.
I'm new to Maven and am probably doing something wrong.
My dependencies look this ::
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>${platform.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.robolectric</groupId>
<artifactId>robolectric</artifactId>
<version>2.0-alpha-1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.j256.ormlite</groupId>
<artifactId>ormlite-android</artifactId>
<version>4.45</version>
</dependency>
<dependency>
<groupId>com.j256.ormlite</groupId>
<artifactId>ormlite-core</artifactId>
<version>4.45</version>
</dependency>
<dependency>
<groupId>com.j256.ormlite</groupId>
<artifactId>ormlite-jdbc</artifactId>
<version>4.45</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.8.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.robolectric</groupId>
<artifactId>robolectric</artifactId>
<version>2.0-rc2</version>
<scope>test</scope>
</dependency>
</dependencies>
Any wisdom on what's going on here will be gratefully received and put to immediate good use :)
Here's the complete pom.xml after updating with Matt's advice. (below) Unfortunately the issue persists.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.odl</groupId>
<artifactId>GhostRunner</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>apk</packaging>
<name>GhostRunner</name>
<properties>
<platform.version> 2.3.3 </platform.version>
<android.sdk.path>/Users/chrisdanson/Development/android-sdk-macosx</android.sdk.path>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>${platform.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.robolectric</groupId>
<artifactId>robolectric</artifactId>
<version>2.1</version>
<!--<scope>test</scope>-->
</dependency>
<dependency>
<groupId>com.j256.ormlite</groupId>
<artifactId>ormlite-android</artifactId>
<version>4.45</version>
</dependency>
<dependency>
<groupId>com.j256.ormlite</groupId>
<artifactId>ormlite-core</artifactId>
<version>4.45</version>
</dependency>
<dependency>
<groupId>com.j256.ormlite</groupId>
<artifactId>ormlite-jdbc</artifactId>
<version>4.45</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
<assetsDirectory>${project.basedir}/assets</assetsDirectory>
<resourceDirectory>${project.basedir}/res</resourceDirectory>
<nativeLibrariesDirectory>${project.basedir}/src/main/native</nativeLibrariesDirectory>
<sdk>
<platform>10</platform>
</sdk>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
So .. having updated the plugin dependency versions and run a mvn 'clean' & 'install' as well the problem is still present. Running a robolectric test gives the following output >>
java.lang.NoClassDefFoundError: org/objectweb/asm/Opcodes
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.getConstructor(Class.java:1657)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:31)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:43)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.Opcodes
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 30 more
Further investigation >
This link shows jars that contain Opcodes and I've added this dependency I found here
<dependency>
<groupId>asm</groupId>
<artifactId>asm-all</artifactId>
<version>2.2</version>
</dependency>
I've added this as the first dependency in the pom and I still get NoClassDefFound for OpCodes.
Finally found something that seems to work :: have added <classifier>jar-with-dependencies</classifier> to the robolectric dependency and the tests finally run.
I see you have
<dependency>
<groupId>org.robolectric</groupId>
<artifactId>robolectric</artifactId>
<version>2.0-alpha-1</version>
<scope>test</scope>
</dependency>
and then
<dependency>
<groupId>org.robolectric</groupId>
<artifactId>robolectric</artifactId>
<version>2.0-rc2</version>
<scope>test</scope>
</dependency>
I don't believe you can have the same dependency listed twice like that and have the app compile but I may be wrong.
None the less, try updating some of your dependency versions. I'm using junit 4.10 with success, along with robolectric 2.1 (2.0 worked as well when I was using that), then mockito is at 1.9.5 as well.
I recommend checking maven central for latest dependencies. I believe there were issues with jUnit 4.11 and robolectric previously though so I haven't tried to upgrade that to 4.11 yet.

Core libraries with android maven plugin

I want to use nativ libraries with android. When i try to complie my project with
mvn clean install
I get an error
[INFO] If you really intend to build a core library -- which is only
[INFO] appropriate as part of creating a full virtual machine
[INFO] distribution, as opposed to compiling an application -- then use
[INFO] the "--core-library" option to suppress this error message.
How to add --core-library param to pom.xml ?
My pom looks like
http://maven.apache.org/maven-v4_0_0.xsd">
4.0.0
<parent>
<groupId>com.temp</groupId>
<artifactId>SipAndroidClient</artifactId>
<version>0.1</version>
</parent>
<artifactId>android-di</artifactId>
<packaging>apk</packaging>
<name>android-di - Application</name>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.pivotallabs</groupId>
<artifactId>robolectric</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
</dependency>
<dependency>
<groupId>org.roboguice</groupId>
<artifactId>roboguice</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>de.mindpipe.android</groupId>
<artifactId>android-logging-log4j</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.2</version>
</dependency>
<dependency>
<groupId>javax.sip</groupId>
<artifactId>jain-sip-api</artifactId>
<version>1.2.1.4</version>
</dependency>
<dependency>
<groupId>javax.sip</groupId>
<artifactId>jain-sip-ri</artifactId>
<version>1.2.167</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
<assetsDirectory>${project.basedir}/assets</assetsDirectory>
<resourceDirectory>${project.basedir}/res</resourceDirectory>
<nativeLibrariesDirectory>${project.basedir}/src/main/native</nativeLibrariesDirectory>
<sdk>
<platform>10</platform>
<path>/home/damian/.android-sdk</path>
</sdk>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
I believe this is what you are looking for http://maven-android-plugin-m2site.googlecode.com/svn/dex-mojo.html
Have a look at the dex section, setting CoreLibrary to true will send "--core-library" to dex.

Categories

Resources