title: Unable to build android project with maven (android-maven-plugin)
body: <p>Strange behavior, sometimes I can package my project, most of the time I cannot.
  The problem happens in <code>android:dex</code>:</p>
  
  <pre><code>$ mvn clean android:dex
  [INFO] Scanning for projects...
  [INFO]                                                                         
  [INFO] ------------------------------------------------------------------------
  [INFO] Building Test 0.0.1
  [INFO] ------------------------------------------------------------------------
  [INFO] 
  [INFO] --- maven-clean-plugin:2.3:clean (default-clean) @ test ---
  [INFO] Deleting file set: /home/danny/workspace/test/target (included: [**], excluded: [])
  [INFO] 
  [INFO] --- android-maven-plugin:3.3.2:dex (default-cli) @ test ---
  [INFO] /usr/lib/jvm/java-6-sun-1.6.0.26/jre/bin/java [-Xmx1024M, -jar, /home/danny/.bin/android-sdk-linux/platform-tools/lib/dx.jar, --dex, --output=/home/danny/workspace/test/target/classes.dex, /home/danny/workspace/test/target/classes]
  [INFO] 
  [INFO] UNEXPECTED TOP-LEVEL EXCEPTION:
  [INFO] java.lang.RuntimeException: /home/danny/workspace/test/target/classes: file not found
  [INFO]  at com.android.dx.util.FileUtils.readFile(FileUtils.java:55)
  [INFO]  at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:134)
  [INFO]  at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
  [INFO]  at com.android.dx.command.dexer.Main.processOne(Main.java:418)
  [INFO]  at com.android.dx.command.dexer.Main.processAllFiles(Main.java:329)
  [INFO]  at com.android.dx.command.dexer.Main.run(Main.java:206)
  [INFO]  at com.android.dx.command.dexer.Main.main(Main.java:174)
  [INFO]  at com.android.dx.command.Main.main(Main.java:91)
  [INFO] 1 error; aborting
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 1.914s
  [INFO] Finished at: Sun Oct 07 20:17:03 CEST 2012
  [INFO] Final Memory: 7M/88M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.3.2:dex (default-cli) on project test: MojoExecutionException: ANDROID-040-001: Could not execute: Command = /bin/sh -c cd /home/danny/workspace/test &amp;&amp; /usr/lib/jvm/java-6-sun-1.6.0.26/jre/bin/java -Xmx1024M -jar /home/danny/.bin/android-sdk-linux/platform-tools/lib/dx.jar --dex --output=/home/danny/workspace/test/target/classes.dex /home/danny/workspace/test/target/classes, Result = 1 -&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/MojoExecutionException
  </code></pre>
  
  <p>I cannot find any information on this...
  My pom.xml:</p>
  
  <pre><code>&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;packaging&gt;apk&lt;/packaging&gt;
      &lt;artifactId&gt;test&lt;/artifactId&gt;
      &lt;groupId&gt;com.example&lt;/groupId&gt;
      &lt;name&gt;Test&lt;/name&gt;
      &lt;version&gt;0.0.1&lt;/version&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;artifactId&gt;android&lt;/artifactId&gt;
              &lt;groupId&gt;com.google.android&lt;/groupId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
              &lt;version&gt;2.2.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
              &lt;version&gt;4.10&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&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.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;plugin&gt;
                  &lt;artifactId&gt;android-maven-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;assetsDirectory&gt;src/main/assets&lt;/assetsDirectory&gt;
                      &lt;resourceDirectory&gt;src/main/resources&lt;/resourceDirectory&gt;
                      &lt;sdk&gt;
                          &lt;platform&gt;8&lt;/platform&gt;
                      &lt;/sdk&gt;
                  &lt;/configuration&gt;
                  &lt;extensions&gt;true&lt;/extensions&gt;
                  &lt;groupId&gt;com.jayway.maven.plugins.android.generation2&lt;/groupId&gt;
                  &lt;version&gt;3.3.2&lt;/version&gt;
              &lt;/plugin&gt;    
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>Running <code>mvn package</code> results in:</p>
  
  <pre><code>$ mvn package
  [INFO] Scanning for projects...
  [INFO]                                                                         
  [INFO] ------------------------------------------------------------------------
  [INFO] Building Test 0.0.1
  [INFO] ------------------------------------------------------------------------
  [INFO] 
  [INFO] --- android-maven-plugin:3.3.2:generate-sources (default-generate-sources) @ test ---
  [INFO] ANDROID-904-002: Found aidl files: Count = 0
  [INFO] ANDROID-904-002: Found aidl files: Count = 0
  [INFO] /home/danny/.bin/android-sdk-linux/platform-tools/aapt [package, -m, -J, /home/danny/workspace/test/target/generated-sources/r, -M, /home/danny/workspace/test/AndroidManifest.xml, -S, /home/danny/workspace/test/src/main/resources, --auto-add-overlay, -A, /home/danny/workspace/test/src/main/assets, -I, /home/danny/.bin/android-sdk-linux/platforms/android-8/android.jar]
  [INFO] 
  [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ test ---
  [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
  [INFO] Copying 8 resources
  [INFO] skip non existing resourceDirectory /home/danny/workspace/test/target/generated-sources/extracted-dependencies/src/main/resources
  [INFO] 
  [INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ test ---
  [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
  [INFO] Compiling 3 source files to /home/danny/workspace/test/target/classes
  [INFO] -------------------------------------------------------------
  [ERROR] COMPILATION ERROR : 
  [INFO] -------------------------------------------------------------
  [ERROR] /home/danny/workspace/test/src/main/java/com/example/test/gui/MainActivity.java:[17,18] package R does not exist
  [ERROR] /home/danny/workspace/test/src/main/java/com/example/test/gui/MainActivity.java:[26,29] package R does not exist
  [INFO] 2 errors 
  [INFO] -------------------------------------------------------------
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 2.960s
  [INFO] Finished at: Sun Oct 07 22:40:35 CEST 2012
  [INFO] Final Memory: 13M/86M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project test: Compilation failure: Compilation failure:
  [ERROR] /home/danny/workspace/test/src/main/java/com/example/test/gui/MainActivity.java:[17,18] package R does not exist
  [ERROR] /home/danny/workspace/test/src/main/java/com/example/test/gui/MainActivity.java:[26,29] package R does not exist
  [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
  </code></pre>