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.
Related
I am getting the following exception when attempting a "mvn install" on an Android project.
[INFO] UNEXPECTED TOP-LEVEL EXCEPTION:
[INFO] java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoIcsImpl;
[INFO] at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)
[INFO] at com.android.dx.dex.file.DexFile.add(DexFile.java:161)
[INFO] at com.android.dx.command.dexer.Main.processClass(Main.java:685)
[INFO] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
[INFO] at com.android.dx.command.dexer.Main.access$600(Main.java:78)
[INFO] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
[INFO] at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
[INFO] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
[INFO] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
[INFO] at com.android.dx.command.dexer.Main.processOne(Main.java:596)
[INFO] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
[INFO] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
[INFO] at com.android.dx.command.dexer.Main.run(Main.java:230)
[INFO] at com.android.dx.command.dexer.Main.main(Main.java:199)
[INFO] at com.android.dx.command.Main.main(Main.java:103)
It looks as though there is some kind of dependency conflict. My pom is as follows
<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">
<parent>
<groupId>com.x.y.z</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../../parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>android-project</artifactId>
<packaging>apk</packaging>
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<sdk>
<platform>19</platform>
<path>${env.ANDROID_HOME}/</path>
</sdk>
<undeployBeforeDeploy>false</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.8.2</version>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<dependency>
<groupId>android</groupId>
<artifactId>android</artifactId>
<version>4.4.2_r3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>android.support</groupId>
<artifactId>compatibility-v4</artifactId>
<version>20.0.0</version>
</dependency>
<dependency>
<groupId>org.androidannotations</groupId>
<artifactId>androidannotations</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>com.mcxiaoke.volley</groupId>
<artifactId>library</artifactId>
<version>1.0.6</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>fr.avianey</groupId>
<artifactId>facebook-android-api</artifactId>
<version>3.17.1</version>
<type>aar</type>
</dependency>
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-core</artifactId>
<version>4.0.2</version>
</dependency>
</dependencies>
</project>
if I make the android support compatibility-v4 dependency provided scope the install runs successfully, but the app crashes at runtime when I run it from IntelliJ as it is unable to inflate the DrawerLayout view.
Any ideas?
For anyone interested, the Facebook api was causing a conflict as it contains the android support v4. I added an exclusion and it works now.
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>
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.
I have been trying to convert my Android project to maven and after some issues I am struggling to deploy. I can clean and install but when it comes to the deploy I get the error:
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.0:deploy (default-cli) on project mega: Uninstall of org.jointsecurityarea.android.mega failed. InstallException: TimeoutException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.0:deploy (default-cli) on project mega: Uninstall of org.jointsecurityarea.android.mega failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
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: org.apache.maven.plugin.MojoExecutionException: Uninstall of org.jointsecurityarea.android.mega failed.
at com.jayway.maven.plugins.android.AbstractAndroidMojo$2.doWithDevice(AbstractAndroidMojo.java:806)
at com.jayway.maven.plugins.android.AbstractAndroidMojo.doWithDevices(AbstractAndroidMojo.java:715)
at com.jayway.maven.plugins.android.AbstractAndroidMojo.undeployApk(AbstractAndroidMojo.java:792)
at com.jayway.maven.plugins.android.AbstractAndroidMojo.undeployApk(AbstractAndroidMojo.java:776)
at com.jayway.maven.plugins.android.AbstractAndroidMojo.deployApk(AbstractAndroidMojo.java:600)
at com.jayway.maven.plugins.android.AbstractAndroidMojo.deployBuiltApk(AbstractAndroidMojo.java:670)
at com.jayway.maven.plugins.android.standalonemojos.DeployMojo.execute(DeployMojo.java:57)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: com.android.ddmlib.InstallException
at com.android.ddmlib.Device.uninstallPackage(Device.java:687)
at com.jayway.maven.plugins.android.AbstractAndroidMojo$2.doWithDevice(AbstractAndroidMojo.java:798)
... 27 more
Caused by: com.android.ddmlib.TimeoutException
at com.android.ddmlib.AdbHelper.read(AdbHelper.java:648)
at com.android.ddmlib.AdbHelper.read(AdbHelper.java:616)
at com.android.ddmlib.AdbHelper.readAdbResponse(AdbHelper.java:216)
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:378)
at com.android.ddmlib.Device.executeShellCommand(Device.java:372)
at com.android.ddmlib.Device.uninstallPackage(Device.java:684)
... 28 more
I am attempting to run this from the command line, not using the m2e plugin. Also, here is my pom.xml 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>
<groupId>org.jointsecurityarea</groupId>
<artifactId>mega</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>apk</packaging>
<name>Mega</name>
<properties>
<platform.version>4.0.1.2</platform.version>
</properties>
<build>
<directory>target</directory>
<outputDirectory>target/classes</outputDirectory>
<finalName>${project.artifactId}-${project.version}</finalName>
<testOutputDirectory>target/test-classes</testOutputDirectory>
<sourceDirectory>src/main/java</sourceDirectory>
<testSourceDirectory>src/test/java</testSourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
</testResources>
<plugins>
<plugin>
<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.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>17</platform>
<path>C:\Android\adt-bundle-windows-x86_64\sdk</path>
</sdk>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
<device>usb</device>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<versionRange>[3.2.0,)</versionRange>
<goals>
<goal>manifest-update</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>fluent-hc</artifactId>
<version>4.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient-cache</artifactId>
<version>4.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.2.3</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
</dependency>
</dependencies>
I am brand new to Maven. Thanks for your help in advance.
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)