title: Building Android app and run Robotium tests with Maven
body: <p>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: </p>
  
  <p>izi-mobiler.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;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"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;pl.araneo.farmadroid&lt;/groupId&gt;
      &lt;artifactId&gt;izi-mobiler&lt;/artifactId&gt;
      &lt;version&gt;366&lt;/version&gt;
      &lt;packaging&gt;pom&lt;/packaging&gt;
      &lt;name&gt;IZI&lt;/name&gt;
  
      &lt;modules&gt;
          &lt;module&gt;izi-mobiler-app&lt;/module&gt;
          &lt;module&gt;izi-mobiler-test&lt;/module&gt;
      &lt;/modules&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
  
      &lt;dependencyManagement&gt;
  
          &lt;dependencies&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;com.google.android&lt;/groupId&gt;
                  &lt;artifactId&gt;android&lt;/artifactId&gt;
                  &lt;version&gt;4.0.1.2&lt;/version&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;com.google.android&lt;/groupId&gt;
                  &lt;artifactId&gt;android-test&lt;/artifactId&gt;
                  &lt;version&gt;4.0.1.2&lt;/version&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;com.pivotallabs&lt;/groupId&gt;
                  &lt;artifactId&gt;robolectric&lt;/artifactId&gt;
                  &lt;version&gt;1.2-SNAPSHOT&lt;/version&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;org.hamcrest&lt;/groupId&gt;
                  &lt;artifactId&gt;hamcrest-core&lt;/artifactId&gt;
                  &lt;version&gt;1.2&lt;/version&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;junit&lt;/groupId&gt;
                  &lt;artifactId&gt;junit&lt;/artifactId&gt;
                  &lt;version&gt;4.8.2&lt;/version&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
                  &lt;artifactId&gt;jackson-core-lgpl&lt;/artifactId&gt;
                  &lt;version&gt;1.7.1&lt;/version&gt;
                  &lt;type&gt;jar&lt;/type&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;org.mockito&lt;/groupId&gt;
                  &lt;artifactId&gt;mockito-core&lt;/artifactId&gt;
                  &lt;version&gt;1.9.0&lt;/version&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;org.roboguice&lt;/groupId&gt;
                  &lt;artifactId&gt;roboguice&lt;/artifactId&gt;
                  &lt;version&gt;2.0&lt;/version&gt;
                  &lt;scope&gt;compile&lt;/scope&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;com.google.inject.extensions&lt;/groupId&gt;
                  &lt;artifactId&gt;guice-multibindings&lt;/artifactId&gt;
                  &lt;version&gt;3.0&lt;/version&gt;
                  &lt;exclusions&gt;
                      &lt;exclusion&gt;
                          &lt;groupId&gt;com.google.inject&lt;/groupId&gt;
                          &lt;artifactId&gt;guice&lt;/artifactId&gt;
                      &lt;/exclusion&gt;
                  &lt;/exclusions&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;com.google.inject.extensions&lt;/groupId&gt;
                  &lt;artifactId&gt;guice-assistedinject&lt;/artifactId&gt;
                  &lt;version&gt;3.0&lt;/version&gt;
                  &lt;exclusions&gt;
                      &lt;exclusion&gt;
                          &lt;groupId&gt;com.google.inject&lt;/groupId&gt;
                          &lt;artifactId&gt;guice&lt;/artifactId&gt;
                      &lt;/exclusion&gt;
                  &lt;/exclusions&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;com.google.android&lt;/groupId&gt;
                  &lt;artifactId&gt;support-v4&lt;/artifactId&gt;
                  &lt;version&gt;r7&lt;/version&gt;
              &lt;/dependency&gt;
  
              &lt;!-- Action Bar sherlock --&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;com.actionbarsherlock&lt;/groupId&gt;
                  &lt;artifactId&gt;library&lt;/artifactId&gt;
                  &lt;version&gt;4.1.0&lt;/version&gt;
                  &lt;type&gt;apklib&lt;/type&gt;
              &lt;/dependency&gt;
  
              &lt;!-- Let Roboguice and Sherlock work together --&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;com.github.rtyley&lt;/groupId&gt;
                  &lt;artifactId&gt;roboguice-sherlock&lt;/artifactId&gt;
                  &lt;version&gt;1.4&lt;/version&gt;
              &lt;/dependency&gt;
  
          &lt;/dependencies&gt;
  
      &lt;/dependencyManagement&gt;
  
      &lt;build&gt;
          &lt;pluginManagement&gt;
              &lt;plugins&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;com.jayway.maven.plugins.android.generation2&lt;/groupId&gt;
                      &lt;artifactId&gt;android-maven-plugin&lt;/artifactId&gt;
                      &lt;version&gt;3.0.0-alpha-13&lt;/version&gt;
                      &lt;extensions&gt;true&lt;/extensions&gt;
                      &lt;configuration&gt;
                          &lt;sdk&gt;
                              &lt;platform&gt;15&lt;/platform&gt;
                          &lt;/sdk&gt;
                          &lt;undeployBeforeDeploy&gt;true&lt;/undeployBeforeDeploy&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                      &lt;version&gt;2.3.2&lt;/version&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/pluginManagement&gt;
      &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <p>izi-mobiler-app.xml</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;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"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  &lt;parent&gt;
      &lt;groupId&gt;pl.araneo.farmadroid&lt;/groupId&gt;
      &lt;artifactId&gt;izi-mobiler&lt;/artifactId&gt;
      &lt;version&gt;366&lt;/version&gt;
      &lt;relativePath&gt;../&lt;/relativePath&gt;
  &lt;/parent&gt;
  
  &lt;groupId&gt;pl.araneo.farmadroid&lt;/groupId&gt;
  &lt;artifactId&gt;izi-mobiler-app&lt;/artifactId&gt;
  &lt;version&gt;366&lt;/version&gt;
  &lt;packaging&gt;apk&lt;/packaging&gt;
  &lt;name&gt;IZI - App&lt;/name&gt;
  
  &lt;properties&gt;
      &lt;platform.version&gt;4.0.1.2&lt;/platform.version&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.android&lt;/groupId&gt;
          &lt;artifactId&gt;android&lt;/artifactId&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.pivotallabs&lt;/groupId&gt;
          &lt;artifactId&gt;robolectric&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.hamcrest&lt;/groupId&gt;
          &lt;artifactId&gt;hamcrest-core&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-core-lgpl&lt;/artifactId&gt;
          &lt;version&gt;1.7.1&lt;/version&gt;
          &lt;type&gt;jar&lt;/type&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.mockito&lt;/groupId&gt;
          &lt;artifactId&gt;mockito-core&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.roboguice&lt;/groupId&gt;
          &lt;artifactId&gt;roboguice&lt;/artifactId&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.inject.extensions&lt;/groupId&gt;
          &lt;artifactId&gt;guice-multibindings&lt;/artifactId&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;com.google.inject&lt;/groupId&gt;
                  &lt;artifactId&gt;guice&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.inject.extensions&lt;/groupId&gt;
          &lt;artifactId&gt;guice-assistedinject&lt;/artifactId&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;com.google.inject&lt;/groupId&gt;
                  &lt;artifactId&gt;guice&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.android&lt;/groupId&gt;
          &lt;artifactId&gt;support-v4&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Action Bar sherlock --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.actionbarsherlock&lt;/groupId&gt;
          &lt;artifactId&gt;library&lt;/artifactId&gt;
          &lt;type&gt;apklib&lt;/type&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Let Roboguice and Sherlock work together --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.github.rtyley&lt;/groupId&gt;
          &lt;artifactId&gt;roboguice-sherlock&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;com.jayway.maven.plugins.android.generation2&lt;/groupId&gt;
              &lt;artifactId&gt;android-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.4.0&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;androidManifestFile&gt;${project.basedir}/AndroidManifest.xml&lt;/androidManifestFile&gt;
                  &lt;assetsDirectory&gt;${project.basedir}/assets&lt;/assetsDirectory&gt;
                  &lt;resourceDirectory&gt;${project.basedir}/res&lt;/resourceDirectory&gt;
                  &lt;nativeLibrariesDirectory&gt;${project.basedir}/src/main/native&lt;/nativeLibrariesDirectory&gt;
                  &lt;sdk&gt;
                      &lt;platform&gt;15&lt;/platform&gt;
                  &lt;/sdk&gt;
                  &lt;undeployBeforeDeploy&gt;true&lt;/undeployBeforeDeploy&gt;
              &lt;/configuration&gt;
              &lt;extensions&gt;true&lt;/extensions&gt;
          &lt;/plugin&gt;
  
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.5.1&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.6&lt;/source&gt;
                  &lt;target&gt;1.6&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <p>izi-mobiler-test.xml</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;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"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  &lt;parent&gt;
      &lt;groupId&gt;pl.araneo.farmadroid&lt;/groupId&gt;
      &lt;artifactId&gt;izi-mobiler&lt;/artifactId&gt;
      &lt;version&gt;366&lt;/version&gt;
  &lt;/parent&gt;
  
  &lt;groupId&gt;pl.araneo.farmadroid&lt;/groupId&gt;
  &lt;artifactId&gt;izi-mobiler-test&lt;/artifactId&gt;
  &lt;packaging&gt;apk&lt;/packaging&gt;
  &lt;name&gt;IZI - Test&lt;/name&gt;
  
  &lt;dependencies&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.jayway.android.robotium&lt;/groupId&gt;
          &lt;artifactId&gt;robotium-solo&lt;/artifactId&gt;
          &lt;version&gt;1.8.0&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.android&lt;/groupId&gt;
          &lt;artifactId&gt;android&lt;/artifactId&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.android&lt;/groupId&gt;
          &lt;artifactId&gt;android-test&lt;/artifactId&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.android&lt;/groupId&gt;
          &lt;artifactId&gt;support-v4&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.actionbarsherlock&lt;/groupId&gt;
          &lt;artifactId&gt;library&lt;/artifactId&gt;
          &lt;type&gt;apklib&lt;/type&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.github.rtyley&lt;/groupId&gt;
          &lt;artifactId&gt;roboguice-sherlock&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;pl.araneo.farmadroid&lt;/groupId&gt;
          &lt;artifactId&gt;izi-mobiler-app&lt;/artifactId&gt;
          &lt;version&gt;366&lt;/version&gt;
          &lt;type&gt;apk&lt;/type&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;pl.araneo.farmadroid&lt;/groupId&gt;
          &lt;artifactId&gt;izi-mobiler-app&lt;/artifactId&gt;
          &lt;version&gt;366&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
          &lt;type&gt;jar&lt;/type&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;com.jayway.maven.plugins.android.generation2&lt;/groupId&gt;
              &lt;artifactId&gt;android-maven-plugin&lt;/artifactId&gt;
              &lt;extensions&gt;true&lt;/extensions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <h2>Stack Trace</h2>
  
  <pre><code>[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] -&gt; [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 &lt;goals&gt; -rf :izi-mobiler-test
  </code></pre>