GithubHelp home page GithubHelp logo

simpligility / android-maven-plugin Goto Github PK

View Code? Open in Web Editor NEW
1.0K 1.0K 391.0 32.83 MB

Maven Plugin for Android Application development and more

Home Page: http://simpligility.github.io/android-maven-plugin/

License: Apache License 2.0

Java 99.89% AIDL 0.11%

android-maven-plugin's Introduction

android-maven-plugin's People

Contributors

albintheander avatar andi12 avatar cescoffier avatar emartynov avatar greek1979 avatar hameno avatar hugojosefson avatar jonasfa avatar jreyes avatar kedzie avatar lyubomyr-shaydariv avatar m00sey avatar malachid avatar mfriedenhagen avatar michalharakal avatar mosabua avatar mttkay avatar nahojkap avatar nicstrong avatar oleggreen avatar pa314159 avatar rtyley avatar secondsun avatar shusshu avatar sisbell avatar spyhunter99 avatar stephanenicolas avatar william-ferguson-au avatar wondercsabo avatar xen0n avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-maven-plugin's Issues

AAR not consuming inner jars

If an AAR file contains dependent jars (within the "libs" folder, as described at http://tools.android.com/tech-docs/new-build-system/aar-format), those are not added to classes.dex.

It looks like the dex command includes target/classes (which is the classes.jar from the AAR), and the dependencies directly. Since the AAR file is a dependency, it is also getting passed to dex, however, according to the dex documentation, files need to either be .zip, .jar, .apk, .class, or a directory.

The correct files get included if, when performing the dex step, the target/unpacked-libs/LIBNAME/libs directory is added to the command

Adding support for multiple dex filex

What steps will reproduce the problem?

  1. build a DEX file with a lots of jars as dependencies

The problem is described here:
https://code.google.com/p/android/issues/detail?id=7147
in short, DX only supports 65536 methods and will fail on large projects.

The workaround is described here:
http://android-developers.blogspot.com/2011/07/custom-class-loading-in-dalvik.html

The workaround is to simply generate multiple dex files and then load them in runtime. Therefore, it would be great if android-maven-plugin could be configured to generate multiple dex files. The configuration can be made very simple, such as:

jettyorg.mortbay.jetty
...

The plugin would then:

  1. generate all secondary dexes, with all classes in given package and subpackages, and put them named as $NAME.dx into the assets/ directory.
  2. generate primary dx file, without classes which went to a secondary dex file.
  3. package

Thanks!

3.9.0-rc1 doesn't work with IntelliJ

This is tracked in the following IntelliJ bug: http://youtrack.jetbrains.com/issue/IDEA-121136

When I try to import my project that uses 3.9.0-rc1 into IntelliJ, I get errors like these:

Error:(2, 2) Guice provision errors:

1) No implementation for org.eclipse.aether.impl.VersionResolver was bound.
  while locating org.eclipse.aether.internal.impl.DefaultRepositorySystem
  at ClassRealm[extension>com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.3-SNAPSHOT-287211315, parent: sun.misc.Launcher$AppClassLoader@1174ec5]
  at ClassRealm[extension>com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.3-SNAPSHOT-287211315, parent: sun.misc.Launcher$AppClassLoader@1174ec5]
  while locating org.eclipse.aether.RepositorySystem
  while locating com.jayway.maven.plugins.android.phase_prebuild.AarMavenLifecycleParticipant
  at ClassRealm[extension>com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.3-SNAPSHOT-287211315, parent: sun.misc.Launcher$AppClassLoader@1174ec5]
  at ClassRealm[extension>com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.3-SNAPSHOT-287211315, parent: sun.misc.Launcher$AppClassLoader@1174ec5]
  while locating org.apache.maven.AbstractMavenLifecycleParticipant annotated with @com.google.inject.name.Named(value=AarMavenLifecycleListener)

Are there plans to do an interim release (especially one that includes a fix for PR 271 that doesn't require maven 3.1 (which IntelliJ doesn't support)?

code that do not make any sense

To @mosabua and @Shusshu
related to #329

I think that some code was missed while merging because next code do not make any sense (skipBuildConfigGeneration( artifact ) always returns false for APKLIB dependencies):

    // Generate the BuildConfig for APKLIB dependencies.
    for ( Artifact artifact : getTransitiveDependencyArtifacts( APKLIB ) )
    {
        if ( skipBuildConfigGeneration( artifact ) )
        {
            continue;
        }
        ....
     }

java-resource folder with META-INF

What's the use of java-resources directory for an unpacked library?

e.g. "unpacked-libs\cas_appcompat-v7\java-resources"

It causes trouble to build the apk because of the META-INF stuff

What's the purpose of that folder ?

It is used in extractAarLib in GenerateSourcesMojo line 454

@mosabua, @william-ferguson-au Maybe one of you know ?

Classloader issue in libraryproject-test

Using the 3.9.0-rc.1 branch or master of the samples project I get

[INFO] --- android-maven-plugin:3.9.0-rc.1:internal-integration-test (default-internal-integration-test) @ libraryprojects-tests ---
[INFO] android.devices parameter not set, using all attached devices
[INFO] Device 03dd80410939aa47_LGE_Nexus5 found.
[INFO] 03dd80410939aa47_LGE_Nexus5 : Running instrumentation tests in com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp.tests
[INFO] 03dd80410939aa47_LGE_Nexus5 : Run started: com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp.tests, 1 tests:
[INFO] 03dd80410939aa47_LGE_Nexus5 : Start [1/1]: android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests#testSuiteConstructionFailed
[INFO] 03dd80410939aa47_LGE_Nexus5 : ERROR:android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests#testSuiteConstructionFailed
[INFO] 03dd80410939aa47_LGE_Nexus5 : java.lang.RuntimeException: Exception during suite construction
at android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests.testSuiteConstructionFailed(TestSuiteBuilder.java:238)
at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:554)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1701)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at android.test.suitebuilder.TestMethod.instantiateTest(TestMethod.java:87)
at android.test.suitebuilder.TestMethod.createTest(TestMethod.java:73)
at android.test.suitebuilder.TestSuiteBuilder.addTest(TestSuiteBuilder.java:262)
at android.test.suitebuilder.TestSuiteBuilder.build(TestSuiteBuilder.java:184)
at android.test.InstrumentationTestRunner.onCreate(InstrumentationTestRunner.java:379)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4335)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NoClassDefFoundError: com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp.MainActivity
at com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp.MainActivityTest.(MainActivityTest.java:16)
... 18 more

[INFO] 03dd80410939aa47_LGE_Nexus5 : End [1/1]: android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests#testSuiteConstructionFailed
[INFO] 03dd80410939aa47_LGE_Nexus5 : Run ended: 12 ms
[ERROR] 03dd80410939aa47_LGE_Nexus5 : FAILURES!!!
[INFO] Tests run: 1, Failures: 0, Errors: 1
[INFO] 03dd80410939aa47_LGE_Nexus5 : Report file written to /Volumes/mac-data/dev/github/jayway/maven-android-plugin-samples/libraryprojects/libraryprojects-tests/target/surefire-reports/TEST-03dd80410939aa47_LGE_Nexus5.xml

Seems like the MainActivity needs to be on the classpath during test execution .. but it is not there for some reason.

maven wagon not found in 3.9.0-rc

The code changes around the newly introduced ClasspathModifierLifecycleParticipant introduces a build error to projects using wagon extensions.

Stacktrace:

org.apache.maven.MavenExecutionException: Could not resolve dependencies for com.simpligility.android.tictactoe:tictactoe-app:apk:1.0.0-SNAPSHOT
    at com.jayway.maven.plugins.android.phase_prebuild.AarMavenLifecycleParticipant.getProjectsArtifacts(AarMavenLifecycleParticipant.java:115)
    at com.jayway.maven.plugins.android.phase_prebuild.AarMavenLifecycleParticipant.afterProjectsRead(AarMavenLifecycleParticipant.java:76)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:271)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Could not resolve dependencies for com.viewpagerindicator:viewpagerindicator:apklib:2.4.2-SNAPSHOT
    at com.jayway.maven.plugins.android.common.DependencyResolver.getDependenciesFor(DependencyResolver.java:109)
    at com.jayway.maven.plugins.android.common.DependencyResolver.getDependenciesFor(DependencyResolver.java:119)
    at com.jayway.maven.plugins.android.common.DependencyResolver.getDependenciesFor(DependencyResolver.java:68)
    at com.jayway.maven.plugins.android.phase_prebuild.AarMavenLifecycleParticipant.getProjectsArtifacts(AarMavenLifecycleParticipant.java:111)
    ... 14 more
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for com.viewpagerindicator:viewpagerindicator:apklib:2.4.2-SNAPSHOT
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:335)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:217)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:288)
    at com.jayway.maven.plugins.android.common.DependencyResolver.getDependenciesFor(DependencyResolver.java:105)
    ... 17 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact com.viewpagerindicator:viewpagerindicator:pom:2.4.2-SNAPSHOT from/to codereligion-mvn-repository-snapshots (s3://codereligion-mvn-repository/snapshots): No connector available to access repository codereligion-mvn-repository-snapshots (s3://codereligion-mvn-repository/snapshots) of type default using the available factories WagonRepositoryConnectorFactory, WagonRepositoryConnectorFactory
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:459)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:262)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:239)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:320)
    ... 20 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact com.viewpagerindicator:viewpagerindicator:pom:2.4.2-SNAPSHOT from/to codereligion-mvn-repository-snapshots (s3://codereligion-mvn-repository/snapshots): No connector available to access repository codereligion-mvn-repository-snapshots (s3://codereligion-mvn-repository/snapshots) of type default using the available factories WagonRepositoryConnectorFactory, WagonRepositoryConnectorFactory
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:546)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:436)
    ... 23 more
Caused by: org.eclipse.aether.transfer.NoRepositoryConnectorException: No connector available to access repository codereligion-mvn-repository-snapshots (s3://codereligion-mvn-repository/snapshots) of type default using the available factories WagonRepositoryConnectorFactory, WagonRepositoryConnectorFactory
    at org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider.newRepositoryConnector(DefaultRepositoryConnectorProvider.java:193)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:531)
    ... 24 more

The following clone of the samples illustrates the problem with the 3.9.0 rc.

Steps to reproduce:

  • checkout and build the most recent version of the 3.9.0 rc
  • checkout https://github.com/SierraGolf/maven-android-plugin-samples/tree/sierragolf/apklib-wagon-problem
  • make sure the samples use the version of the 3.9.0 rc you want to test (currently it is set to 3.9.0-SNAPSHOT)
  • run rm -r ~/.m2/repository/com/viewpagerindicator (remove of local apklib)
  • run mvn clean install -Daws.accessKeyId=AKIAJSGSWCG4CN33PJNQ -Daws.secretKey=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 in the tictactoe project

A little background on the above:

  • I added an old version of the view pager indicator as a dependency to the tictactoe project
  • I added the s3 wagon as a build extension to the tictactoe project
  • I added a temporary s3 test bucket as snapshot repository to the tictactoe project

The above mentioned steps work with the maven-android-plugin in version 3.8.2 but not in version 3.9.0-rc.

Aapt problems with samples

I get the following issue with all the latest merges in as of

5896c1e

This might be due to some of the aapt related changes from @Marchelo

[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ libraryprojects-aar1 ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ libraryprojects-aar1 ---
[INFO] Building jar: /Volumes/mac-data/dev/github/jayway/maven-android-plugin-samples/libraryprojects/libraryprojects-aar1/target/libraryprojects-aar1-1.0.0-SNAPSHOT.jar
[INFO]
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:aar (default-aar) @ libraryprojects-aar1 ---
[INFO] Generating AAR file : libraryprojects-aar1
[INFO] Generating aar
[INFO] ERROR: Unknown command '-m'
[INFO] Android Asset Packaging Tool
[INFO]
[INFO] Usage:
[INFO] aapt l[ist] [-v] [-a] file.{zip,jar,apk}
[INFO] List contents of Zip-compatible archive.
[INFO]
[INFO] aapt d[ump] [--values] WHAT file.{apk} [asset [asset ...]]
[INFO] strings Print the contents of the resource table string pool in the APK.
[INFO] badging Print the label and icon for the app declared in APK.
[INFO] permissions Print the permissions from the APK.
[INFO] resources Print the resource table from the APK.
[INFO] configurations Print the configurations in the APK.
[INFO] xmltree Print the compiled xmls in the given assets.
[INFO] xmlstrings Print the strings of the given compiled xml assets.
[INFO]
[INFO] aapt p[ackage] [-d][-f][-m][-u][-v][-x][-z][-M AndroidManifest.xml]
[INFO] [-0 extension [-0 extension ...]] [-g tolerance] [-j jarfile]
[INFO] [--debug-mode] [--min-sdk-version VAL] [--target-sdk-version VAL]
[INFO] [--app-version VAL] [--app-version-name TEXT] [--custom-package VAL]
[INFO] [--rename-manifest-package PACKAGE]
[INFO] [--rename-instrumentation-target-package PACKAGE]
[INFO] [--utf16] [--auto-add-overlay]
[INFO] [--max-res-version VAL]
[INFO] [-I base-package [-I base-package ...]]
[INFO] [-A asset-source-dir] [-G class-list-file] [-P public-definitions-file]
[INFO] [-S resource-sources [-S resource-sources ...]]
[INFO] [-F apk-file] [-J R-file-dir]
[INFO] [--product product1,product2,...]
[INFO] [-c CONFIGS] [--preferred-configurations CONFIGS]
[INFO] [raw-files-dir [raw-files-dir] ...]
[INFO] [--output-text-symbols DIR]
[INFO]
[INFO] Package the android resources. It will read assets and resources that are
[INFO] supplied with the -M -A -S or raw-files-dir arguments. The -J -P -F and -R
[INFO] options control which files are output.
[INFO]
[INFO] aapt r[emove] [-v] file.{zip,jar,apk} file1 [file2 ...]
[INFO] Delete specified files from Zip-compatible archive.
[INFO]
[INFO] aapt a[dd] [-v] file.{zip,jar,apk} file1 [file2 ...]
[INFO] Add specified files to Zip-compatible archive.
[INFO]
[INFO] aapt c[runch] [-v] -S resource-sources ... -C output-folder ...
[INFO] Do PNG preprocessing on one or several resource folders
[INFO] and store the results in the output folder.
[INFO]
[INFO] aapt s[ingleCrunch] [-v] -i input-file -o outputfile
[INFO] Do PNG preprocessing on a single file.
[INFO]
[INFO] aapt v[ersion]
[INFO] Print program version.
[INFO]
[INFO] Modifiers:
[INFO] -a print Android-specific data (resources, manifest) when listing
[INFO] -c specify which configurations to include. The default is all
[INFO] configurations. The value of the parameter should be a comma
[INFO] separated list of configuration values. Locales should be specified
[INFO] as either a language or language-region pair. Some examples:
[INFO] en
[INFO] port,en
[INFO] port,land,en_US
[INFO] If you put the special locale, zz_ZZ on the list, it will perform
[INFO] pseudolocalization on the default locale, modifying all of the
[INFO] strings so you can look for strings that missed the
[INFO] internationalization process. For example:
[INFO] port,land,zz_ZZ
[INFO] -d one or more device assets to include, separated by commas
[INFO] -f force overwrite of existing files
[INFO] -g specify a pixel tolerance to force images to grayscale, default 0
[INFO] -j specify a jar or zip file containing classes to include
[INFO] -k junk path of file(s) added
[INFO] -m make package directories under location specified by -J
[INFO] -u update existing packages (add new, replace older, remove deleted files)
[INFO] -v verbose output
[INFO] -x create extending (non-application) resource IDs
[INFO] -z require localization of resource attributes marked with
[INFO] localization="suggested"
[INFO] -A additional directory in which to find raw asset files
[INFO] -G A file to output proguard options into.
[INFO] -F specify the apk file to output
[INFO] -I add an existing package to base include set
[INFO] -J specify where to output R.java resource constant definitions
[INFO] -M specify full path to AndroidManifest.xml to include in zip
[INFO] -P specify where to output public resource definitions
[INFO] -S directory in which to find resources. Multiple directories will be scanned
[INFO] and the first match found (left to right) will take precedence.
[INFO] -0 specifies an additional extension for which such files will not
[INFO] be stored compressed in the .apk. An empty string means to not
[INFO] compress any files at all.
[INFO] --debug-mode
[INFO] inserts android:debuggable="true" in to the application node of the
[INFO] manifest, making the application debuggable even on production devices.
[INFO] --min-sdk-version
[INFO] inserts android:minSdkVersion in to manifest. If the version is 7 or
[INFO] higher, the default encoding for resources will be in UTF-8.
[INFO] --target-sdk-version
[INFO] inserts android:targetSdkVersion in to manifest.
[INFO] --max-res-version
[INFO] ignores versioned resource directories above the given value.
[INFO] --values
[INFO] when used with "dump resources" also includes resource values.
[INFO] --version-code
[INFO] inserts android:versionCode in to manifest.
[INFO] --version-name
[INFO] inserts android:versionName in to manifest.
[INFO] --custom-package
[INFO] generates R.java into a different package.
[INFO] --extra-packages
[INFO] generate R.java for libraries. Separate libraries with ':'.
[INFO] --generate-dependencies
[INFO] generate dependency files in the same directories for R.java and resource package
[INFO] --auto-add-overlay
[INFO] Automatically add resources that are only in overlays.
[INFO] --preferred-configurations
[INFO] Like the -c option for filtering out unneeded configurations, but
[INFO] only expresses a preference. If there is no resource available with
[INFO] the preferred configuration then it will not be stripped.
[INFO] --rename-manifest-package
[INFO] Rewrite the manifest so that its package name is the package name
[INFO] given here. Relative class names (for example .Foo) will be
[INFO] changed to absolute names with the old package so that the code
[INFO] does not need to change.
[INFO] --rename-instrumentation-target-package
[INFO] Rewrite the manifest so that all of its instrumentation
[INFO] components target the given package. Useful when used in
[INFO] conjunction with --rename-manifest-package to fix tests against
[INFO] a package that has been renamed.
[INFO] --product
[INFO] Specifies which variant to choose for strings that have
[INFO] product variants
[INFO] --utf16
[INFO] changes default encoding for resources to UTF-16. Only useful when API
[INFO] level is set to 7 or higher where the default encoding is UTF-8.
[INFO] --non-constant-id
[INFO] Make the resources ID non constant. This is required to make an R java class
[INFO] that does not contain the final value but is used to make reusable compiled
[INFO] libraries that need to access resources.
[INFO] --error-on-failed-insert
[INFO] Forces aapt to return an error if it fails to insert values into the manifest
[INFO] with --debug-mode, --min-sdk-version, --target-sdk-version --version-code
[INFO] and --version-name.
[INFO] Insertion typically fails if the manifest already defines the attribute.
[INFO] --output-text-symbols
[INFO] Generates a text file containing the resource symbols of the R class in the
[INFO] specified folder.
[INFO] --ignore-assets
[INFO] Assets to be ignored. Default pattern is:
[INFO] !.svn:!.git:!.ds_store:!.scc:.:

__:!CVS:!thumbs.db:!picasa.ini:!_~
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Android SDK ApiDemos - Parent ..................... SUCCESS [ 0.358 s]
[INFO] Android SDK ApiDemos - Application ................ SUCCESS [ 29.072 s]
[INFO] Android SDK ApiDemos - Instrumentation Test ....... SUCCESS [ 14.319 s]
[INFO] HelloFlashlight ................................... SUCCESS [ 1.289 s]
[INFO] MorseFlash - Parent ............................... SUCCESS [ 0.016 s]
[INFO] MorseFlash - Library .............................. SUCCESS [ 1.940 s]
[INFO] MorseFlash - App .................................. SUCCESS [ 2.103 s]
[INFO] MorseFlash - Instrumentation Test ................. SUCCESS [ 12.573 s]
[INFO] Scala Application ................................. SUCCESS [ 25.554 s]
[INFO] Library Projects - Parent ......................... SUCCESS [ 0.005 s]
[INFO] Library Projects - AAR 1 .......................... FAILURE [ 0.561 s]
[INFO] Library Projects - APKLIB 1 ....................... SKIPPED
[INFO] Library Projects - Apklib from Apklib ............. SKIPPED
[INFO] Library Projects - AAR from AAR ................... SKIPPED
[INFO] Library Projects - Main App ....................... SKIPPED
[INFO] Library Projects - Instrumentation Tests .......... SKIPPED
[INFO] Library Projects - AAR Consumption ActionBarSherlock SKIPPED
[INFO] Android NDK - Aggregator .......................... SKIPPED
[INFO] Android NDK - Native Sample ...............

support-v4 20.0.0 aar consumption not working

The new support-v4 20.0.0 is now packaged as an aar instead of jar and this aar is using the libs folder to store an internal lib.

Inside the aar you have:

/libs/internal-impl-20.0.0.jar 

Why was it done even when Xavier mentioned on the adt mailing list that they allowed the libs folder for certain use case but wasn't the recommended way.
https://groups.google.com/forum/#!topic/adt-dev/t3bubNkssRo

    Manfred Moser    5/30/13
so you are allowing libs .. that seems like a terrible idea.. 

Xavier Ducrohet     5/30/13

oh it's a terrible idea indeed. but like the rest of Gradle, if you want/need to use local jar you should be able to.

This is definitively not the recommended way to do this, and we may actually display some warning so that people are aware about what they are doing.

So what do we do now?

  1. Ask Xavier to change their lib
  2. support the libs inside the aar

ClasspathModifierLifecycleParticipant netbeans warning

Since ClasspathModifierLifecycleParticipant has been added, there is a warning on netbeans. And we can not ignore it. (3.9.0-rc.2)

Full warning message:
"The IDE will not execute any 3rd party extension code during Maven project loading.
These can have significant influence on performance of the Maven model (re)loading or interfere with IDE's own codebase. On the other hand the model loaded can be incomplete without their participation. In this project we have discovered the following external build participants:
com.jayway.maven.plugins.android.phase_prebuild.ClasspathModifierLifecycleParticipant"

Is there another solution?

If AAR dependency is project, classes.jar is empty and extract fails at unzipping

Plugin version: Current 4.0.0-SNAPSHOT
Goal: compile

In a simple project where an apk module depends on an aar module, source generation fails because of the following:

[INFO] --- android-maven-plugin:3.9.0-rc.2:generate-sources (default-generate-sources) @ android-app ---
[INFO] Extracting libs
[INFO] Extracting apklib android-push...
[WARNING] The apklib artifact points to 'C:\Users\msbarnar\Projects\videohelper\android-parent\android-push\target\classes' which is a directory; skipping unpacking it.
[INFO] Extracting aar play-services...
[INFO] Getting manifests of dependent apklibs
[ERROR] Error when generating sources.
org.apache.maven.plugin.MojoExecutionException: android-push is missing AndroidManifest.xml
  at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.mergeManifests(GenerateSourcesMojo.java:923)
  at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:274)

This is reproduced for me by the sample project TicTacToe - Parent. It happens because the classes.jar that ends up in target/unpacked-libs of the apk module (e.g. tictactoe-app/target/unpacked-libs/csat_tictactoe-library) is empty.

This is handled in GenerateSourcesMojo#extractAarLib() where the warning about the aar being a directory is generated. It ignores that warning and tries to unzip the classes jar anyway, resulting in the above unzip exception.

case when aar project have apklib dependencies doesn't work

Hello, everyone.

I've got several issues for the case when aar depends on apklib.
And I've heard from Manfred that this type of dependency will not support any more.
I'm proposing :

  1. If such type of dependency doesn't planned to have support from android-maven-plugin ->
  • android-maven-plugin should throw exception with detailed description(that such type of dependency doesn't support any more)
  • and announce that at least on changelog page of a project website
  1. Otherwise -> we should fix such issues and in future start test all features or bug-fixes for mentioned case too.

resources merging when using resourceOverlayDirectory parameter

I've met an issue with "resourceOverlayDirectory" parameter on a project site:
https://code.google.com/p/maven-android-plugin/issues/detail?id=384

And it can be still reproduced on a latest revision.
I've checked sources of a android-maven-plugin, and seems that there is no functionality for merging such resources, like: string.xml, color.xml etc. Correct me if I'm wrong.

But it is critical for proper behavior of a "resourceOverlayDirectory" parameter.

Does it suppose to be implemented in future?

P.S: maybe some android.tools.* libraries have such functionality?

3.9.0-rc.2 complete support for AAR format?

Hi,
I'm trying to use the AAR dependency format to add an Android library that include Jar & *.so (native shared lib).

the AAR format should support the optional "libs" & "jni" folders
http://tools.android.com/tech-docs/new-build-system/aar-format

But I couldn't get android-maven-plugin to include these files (tested with "3.8.x" & "3.9.0-rc.2")

The plugin unpack correctly the content of the AAR though, but only the classes.jar are add to the APK project

unpacked-libs/
โ””โ”€โ”€ cs_snappydb-lib
    โ”œโ”€โ”€ AndroidManifest.xml
    โ”œโ”€โ”€ aidl
    โ”œโ”€โ”€ assets
    โ”œโ”€โ”€ classes.jar
    โ”œโ”€โ”€ java-resources
    โ”‚ย ย  โ”œโ”€โ”€ META-INF
    โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ MANIFEST.MF
    โ”‚ย ย  โ””โ”€โ”€ com
    โ”‚ย ย      โ””โ”€โ”€ snappydb
    โ”‚ย ย          โ””โ”€โ”€ internal
    โ”œโ”€โ”€ jni
    โ”‚ย ย  โ”œโ”€โ”€ armeabi
    โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ libsnappydb-native.so
    โ”‚ย ย  โ”œโ”€โ”€ armeabi-v7a
    โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ libsnappydb-native.so
    โ”‚ย ย  โ”œโ”€โ”€ mips
    โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ libsnappydb-native.so
    โ”‚ย ย  โ””โ”€โ”€ x86
    โ”‚ย ย      โ””โ”€โ”€ libsnappydb-native.so
    โ”œโ”€โ”€ libs
    โ”‚ย ย  โ”œโ”€โ”€ kryo-2.24.0.jar
    โ”‚ย ย  โ”œโ”€โ”€ minlog-1.2.jar
    โ”‚ย ย  โ””โ”€โ”€ objenesis-1.2.jar
    โ””โ”€โ”€ res

here is my pom

    ...
     <version>0.3.0</version>
     <packaging>apk</packaging>

    <dependencies>
      ...
    <dependency>
            <groupId>com.snappydb</groupId>
            <artifactId>snappydb-lib</artifactId>
            <version>${project.version}</version>
            <type>aar</type>
            <scope>compile</scope>
        </dependency>
    </dependencies>
    ...
   <build>
            <plugins>
                <plugin>
                    <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                    <artifactId>android-maven-plugin</artifactId>
                    <extensions>true</extensions>
                    <version>3.9.0-rc.2</version>
                    <configuration>
                        <sdk>
                            <platform>19</platform>
                        </sdk>
                    </configuration>
                </plugin>
            </plugins>
    </build>
</project>
mvn -v
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 16:22:22+0100)
Maven home: /Android/apache-maven-3.1.1
Java version: 1.7.0_55, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.9.2", arch: "x86_64", family: "mac"

Thanks,
Regards,

ps: Please find the complete project here

Run tests using proguard .jar

It would be useful to be able to re-run the tests [again] against the proguard .jar, otherwise missing classes or class members can only be found at runtime if the proguard configuration is wrong.

(When using robolectric to test, not a separate project)

java.lang.NoClassDefFoundError with the aapt options --rename-manifest-package and --rename-instrumentation-target-package

What steps will reproduce the problem?

  1. create an Android projet with the android-release archetype available on the link https://github.com/akquinet/android-archetypes
  2. In the projet Android, add configuration in the plugin android-maven-plugin :
    ${project.groupId}.std
  3. In the projet Android-it, add configuration in the plugin android-maven-plugin :

${project.groupId}.std
${project.groupId}.std

${project.groupId}.dev
android.test.InstrumentationTestRunner

What is the expected output?

mvn clean verify
...
[INFO] --- android-maven-plugin:3.8.2:internal-integration-test (default-internal-integration-test) @ android-demo-it ---
[INFO] Found 1 devices connected with the Android Debug Bridge
[INFO] android.device parameter not set, using all attached devices
[INFO] Device 4df19dd060da5f81_samsung_GT-I9300 found.
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Running tests for specified test package: com.xxx.demo.test
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Running instrumentation tests in com.xxx.demo.test
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Run started: com.xxx.demo.test, 1 tests:
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Start [1/1]: com.xxx.demo.test.HelloAndroidActivityTest#testActivity
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : End [1/1]: com.xxx.demo.test.HelloAndroidActivityTest#testActivity
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Run ended: 632 ms
[INFO] Tests run: 1, Failures: 0, Errors: 0
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Report file written to D:\workshop\Perso\repo\git\perso\android-demo-parent\android-demo-it\target-dev\surefire-reports\TEST-4df19dd060da5f81_samsung_GT-I9300.xml
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] android-demo - Parent ............................. SUCCESS [0.163s]
[INFO] android-demo - Application ........................ SUCCESS [10.197s]
[INFO] android-demo-it - Integration tests ............... SUCCESS [29.012s]
[INFO] ------------------------------------------------------------------------

What do you see instead?

mvn clean verify
...
[INFO] --- android-maven-plugin:3.8.2:internal-integration-test (default-internal-integration-test) @ android-demo-it ---
[INFO] Found 1 devices connected with the Android Debug Bridge
[INFO] android.device parameter not set, using all attached devices
[INFO] Device 4df19dd060da5f81_samsung_GT-I9300 found.
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Running tests for specified test package: com.xxx.demo.test
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Running instrumentation tests in com.xxx.demo.dev
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Run started: com.xxx.demo.dev, 1 tests:
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Start [1/1]: android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests#testSuiteConstructionFailed
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : ERROR:android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests#testSuiteConstructionFailed
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : java.lang.RuntimeException: Exception during suite construction
at android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests.testSuiteConstructionFailed(TestSuiteBuilder.java:238)
at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:554)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1738)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.test.suitebuilder.TestMethod.instantiateTest(TestMethod.java:87)
at android.test.suitebuilder.TestMethod.createTest(TestMethod.java:73)
at android.test.suitebuilder.TestSuiteBuilder.addTest(TestSuiteBuilder.java:262)
at android.test.suitebuilder.TestSuiteBuilder.build(TestSuiteBuilder.java:184)
at android.test.InstrumentationTestRunner.onCreate(InstrumentationTestRunner.java:379)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4675)
at android.app.ActivityThread.access$1400(ActivityThread.java:159)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1376)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5419)
at java.lang.reflect.Method.invokeNative(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NoClassDefFoundError: com.xxx.demo.HelloAndroidActivity
at com.xxx.demo.test.HelloAndroidActivityTest.(HelloAndroidActivityTest.java:9)
... 18 more

[INFO] 4df19dd060da5f81_samsung_GT-I9300 : End [1/1]: android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests#testSuiteConstructionFailed
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Run ended: 24 ms
[ERROR] 4df19dd060da5f81_samsung_GT-I9300 : FAILURES!!!
[INFO] Tests run: 1, Failures: 0, Errors: 1
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Report file written to D:\workshop\Perso\repo\git\perso\android-demo-parent\android-demo-it\target-dev\surefire-reports\TEST-4df19dd060
da5f81_samsung_GT-I9300.xml
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] android-demo - Parent ............................. SUCCESS [0.112s]
[INFO] android-demo - Application ........................ SUCCESS [11.781s]
[INFO] android-demo-it - Integration tests ............... FAILURE [2:26.717s]
[INFO] ------------------------------------------------------------------------

Error :
Caused by: java.lang.NoClassDefFoundError: com.xxx.demo.HelloAndroidActivity
at com.xxx.demo.test.HelloAndroidActivityTest.(HelloAndroidActivityTest.java:9)

Except I'm mistaken, the class HelloAndroidActivity should be always found in the package com.xxx.demo even thouth the manifest package is renamed.

--rename-manifest-package
Rewrite the manifest so that its package name is the package name
given here. Relative class names (for example .Foo) will be
changed to absolute names with the old package so that the code
does not need to change.
--rename-instrumentation-target-package
Rewrite the manifest so that all of its instrumentation
components target the given package. Useful when used in
conjunction with --rename-manifest-package to fix tests against
a package that has been renamed.

What version of maven-android-plugin are you using?

android-maven-plugin:3.8.2

What are the complete output lines of "mvn -version" on your machine?

$ mvn --version
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 17:22:22+0200)
Maven home: d:\bin\apache-maven-3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
Java home: c:\Program Files (x86)\Java\jdk1.7.0_45\jre
Default locale: fr_FR, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"

Please provide any additional information below.

Multiple NDK architectures not present in APK, mvn 3.1.1, plugin 3.8.2.

What steps will reproduce the problem?

  1. Make a pom.xml with a native library xxx. Add two architectures:
      <ndkArchitectures>armeabi armeabi-v7a</ndkArchitectures>
  1. mvn package

What is the expected output?

An APK with lib/armeabi-v7a/xxx.so and lib/armeabi/xxx.so

What do you see instead?

APK only contains lib/armeabi-v7a/xxx.so.

Also, the directory where the build is done only has libs/armeabi-v7a/xxx.so,
libs/armeabi/xxx.so is missing here too.

What version of maven-android-plugin are you using?

3.8.2.

What are the complete output lines of "mvn -version" on your machine?

Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 17:22:22+0200)
Maven home: /usr/local/apache-maven
Java version: 1.6.0_65, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: sv_SE, platform encoding: MacRoman
OS name: "mac os x", version: "10.9.1", arch: "x86_64", family: "mac"

Please provide any additional information below.

The output from the build suggests armeabi is build, and it is in the obj/ directory:

[INFO] --- android-maven-plugin:3.8.2:ndk-build (default) @ BlaAndroid ---
[INFO] executing 8 parallel jobs
[INFO] /Users/xxx/android-ndk-current/ndk-build [-C, /Users/xx/1.3.44, -j, 8, NDK_TOOLCHAIN=arm-linux-androideabi-4.6, APP_ABI=armeabi, xxx]
[INFO] Cleaning up extracted include directories used for build
[INFO] executing 8 parallel jobs
[INFO] /Users/xxx/android-ndk-current/ndk-build [-C, /Users/xxx/1.3.44, -j, 8, NDK_TOOLCHAIN=arm-linux-androideabi-4.6, APP_ABI=armeabi-v7a, xxx]
[INFO] Cleaning up extracted include directories used for build

Workaround is to set target to:

APP_ABI=armeabi armeabi-v7a

I don't understand the reason for this plugin to mess with APP_ABI at all, the info is in the Application.mk file already. Ditto NDK_TOOLCHAIN and target. A way to specify that a plain ndk-build without any arguments should be run would be appreciated. Or a way to say that no APP_ABI and/or no NDK_TOOLCHAIN and/or no target should be passed to ndk-build.

Samples project build failing with dependency resolution problems

With the latest master as off

eb7b128

the samples project build does not start up due to not finding dependencies in the repository manager. However these are in the local repo and in the reactor of the multi module build. This is how it shows

Run
mvn clean install
in the root of the samples with the android mavne plugin

rm -rf ~/.m2/repository/com/jayway/
[/Users/manfred/dev/github/jayway/maven-android-plugin-samples] $mci
[INFO] Scanning for projects...
Downloading: http://localhost:8081/nexus/content/groups/public/com/jayway/maven/plugins/android/generation2/samples/apidemos-android-16/apidemos-application/1.0.0-SNAPSHOT/maven-metadata.xml
Downloading: http://localhost:8081/nexus/content/groups/public/com/jayway/maven/plugins/android/generation2/samples/apidemos-android-16/apidemos-application/1.0.0-SNAPSHOT/apidemos-application-1.0.0-SNAPSHOT.apk
Downloading: http://localhost:8081/nexus/content/groups/public/com/jayway/maven/plugins/android/generation2/samples/apidemos-android-16/apidemos-application/1.0.0-SNAPSHOT/apidemos-application-1.0.0-SNAPSHOT.jar
[ERROR] Could not resolve dependencies for project : MavenProject: com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-tests:1.0.0-SNAPSHOT @ /Volumes/mac-data/dev/github/jayway/maven-android-plugin-samples/apidemos-android-16/apidemos-tests/pom.xml: Could not resolve project dependency graph: Could not resolve dependencies for project com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-tests:apk:1.0.0-SNAPSHOT: The following artifacts could not be resolved: com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-application:apk:1.0.0-SNAPSHOT, com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-application:jar:1.0.0-SNAPSHOT: Could not find artifact com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-application:apk:1.0.0-SNAPSHOT in nexus (http://localhost:8081/nexus/content/groups/public) -> [Help 1]
[ERROR]

Running with -X -e you get the stack traces that show more details and the potential problem in DependencyResolver

tory)
[DEBUG] Failure to find com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-application:1.0.0-SNAPSHOT/maven-metadata.xml in http://localhost:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced
[ERROR] Could not resolve dependencies for project : MavenProject: com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-tests:1.0.0-SNAPSHOT @ /Volumes/mac-data/dev/github/jayway/maven-android-plugin-samples/apidemos-android-16/apidemos-tests/pom.xml: Could not resolve project dependency graph: Could not resolve dependencies for project com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-tests:apk:1.0.0-SNAPSHOT: The following artifacts could not be resolved: com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-application:apk:1.0.0-SNAPSHOT, com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-application:jar:1.0.0-SNAPSHOT: Failure to find com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-application:apk:1.0.0-SNAPSHOT in http://localhost:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [Help 1]
org.apache.maven.MavenExecutionException: Could not resolve dependencies for project : MavenProject: com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-tests:1.0.0-SNAPSHOT @ /Volumes/mac-data/dev/github/jayway/maven-android-plugin-samples/apidemos-android-16/apidemos-tests/pom.xml
at com.jayway.maven.plugins.android.phase_prebuild.ClasspathModifierLifecycleParticipant.afterProjectsRead(ClasspathModifierLifecycleParticipant.java:79)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:274)
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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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: Could not resolve project dependency graph
at com.jayway.maven.plugins.android.common.DependencyResolver.getProjectDependenciesFor(DependencyResolver.java:51)
at com.jayway.maven.plugins.android.phase_prebuild.ClasspathModifierLifecycleParticipant.afterProjectsRead(ClasspathModifierLifecycleParticipant.java:75)
... 13 more
Caused by: org.apache.maven.shared.dependency.graph.DependencyGraphBuilderException: Could not resolve dependencies for project com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-tests:apk:1.0.0-SNAPSHOT: The following artifacts could not be resolved: com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-application:apk:1.0.0-SNAPSHOT, com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-application:jar:1.0.0-SNAPSHOT: Failure to find com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-application:apk:1.0.0-SNAPSHOT in http://localhost:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced
at org.apache.maven.shared.dependency.graph.internal.Maven3DependencyGraphBuilder.buildDependencyGraph(Maven3DependencyGraphBuilder.java:80)
at org.apache.maven.shared.dependency.graph.internal.DefaultDependencyGraphBuilder.buildDependencyGraph(DefaultDependencyGraphBuilder.java:63)
at com.jayway.maven.plugins.android.common.DependencyResolver.getProjectDependenciesFor(DependencyResolver.java:47)
... 14 more
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-tests:apk:1.0.0-SNAPSHOT: The following artifacts could not be resolved: com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-application:apk:1.0.0-SNAPSHOT, com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-application:jar:1.0.0-SNAPSHOT: Failure to find com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-application:apk:1.0.0-SNAPSHOT in http://localhost:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:189)
at org.apache.maven.shared.dependency.graph.internal.Maven3DependencyGraphBuilder.buildDependencyGraph(Maven3DependencyGraphBuilder.java:74)
... 16 more
Caused by: org.sonatype.aether.resolution.DependencyResolutionException: The following artifacts could not be resolved: com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-application:apk:1.0.0-SNAPSHOT, com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-application:jar:1.0.0-SNAPSHOT: Failure to find com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-application:apk:1.0.0-SNAPSHOT in http://localhost:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:375)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:183)
... 17 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: The following artifacts could not be resolved: com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-application:apk:1.0.0-SNAPSHOT, com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-application:jar:1.0.0-SNAPSHOT: Failure to find com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-application:apk:1.0.0-SNAPSHOT in http://localhost:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:358)
... 18 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Failure to find com.jayway.maven.plugins.android.generation2.samples.apidemos-android-16:apidemos-application:apk:1.0.0-SNAPSHOT in http://localhost:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced
at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:230)
at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:204)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:427)
... 20 more
[ERROR]
[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/MavenExecutionException

4.0.0-SNAPSHOT generates DEX multi-def errors, 3.8.2 does not

Identical settings, simply changed POM to reference 4.0.0-SNAPSHOT (30May @ noon) instead of 3.8.2 for plugin version.

Android Studio debug for app is configured to run "Gradle-aware Make" prior to launch.

"mvn clean install" works fine for both 3.8.2 and 4.0.0-SNAPSHOT.

Launching debug for app from Android Studio works after APK created by 3.8.2, but generates DEX multi-def errors after APK created by 4.0.0-SNAPSHOT.

Error while packaging

its days im trying to integrate maven with android.
finally,the app work and the mvn compile is compiling my app but when im packaging i get the folowing error:

This is my pom.xml:


4.0.0
com.stoker
gs-maven-android
0.1.0
apk


<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<repositories>
    <repository>
        <id>The mavenized Facebook Android API</id>
        <url>http://avianey.github.com/facebook-api-android-maven/</url>
    </repository>

    <repository>
        <id>android.support-mvn-repo</id>
        <url>https://raw.github.com/kmchugh/android.support/mvn-repo</url>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>daily</updatePolicy>
        </snapshots>
    </repository>

</repositories>

<dependencies>
    <dependency>
        <groupId>com.google.android</groupId>
        <artifactId>android</artifactId>
        <version>4.1.1.4</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>com.actionbarsherlock</groupId>
        <artifactId>sample-roboguice</artifactId>
        <version>4.4.0</version>
    </dependency>

    <dependency>
        <groupId>com.github.avianey</groupId>
        <artifactId>facebook-android-api</artifactId>
        <version>3.0.0</version>
        <type>apklib</type>
    </dependency>

    <dependency>
        <groupId>com.google.code.facebookapi</groupId>
        <artifactId>facebook-java-api</artifactId>
        <version>3.0.4</version>
    </dependency>

    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.2.4</version>
    </dependency>

    <dependency>
        <groupId>com.koushikdutta.ion</groupId>
        <artifactId>ion</artifactId>
        <version>1.2.4</version>
    </dependency>

    <dependency>
        <groupId>com.google.android.gms</groupId>
        <artifactId>google-play-services</artifactId>
        <version>14.0.0</version>
    </dependency>

    <dependency>
        <groupId>com.android.support</groupId>
        <artifactId>support-v13</artifactId>
        <version>1.1.1</version>
        <scope>compile</scope>
    </dependency>


    <dependency>
        <groupId>com.google.android.gcm</groupId>
        <artifactId>gcm-server</artifactId>
        <version>1.0.2</version>
    </dependency>


</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>com.jayway.maven.plugins.android.generation2</groupId>
            <artifactId>android-maven-plugin</artifactId>
            <version>3.8.2</version>
            <configuration>
                <sdk>
                    <platform>19</platform>
                </sdk>
                <deleteConflictingFiles>true</deleteConflictingFiles>
                <undeployBeforeDeploy>true</undeployBeforeDeploy>
            </configuration>
            <extensions>true</extensions>
        </plugin>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
    </plugins>
</build>

[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:dex (default-dex) on project gs-maven-android: MojoExecutionException: ANDROID-040-001: Could not execute: Command = cmd.exe /X /C ""C:\Program Files\Java\jdk1.7.0_17\jre\bin\java" -Xmx1024M -jar C:\Users\alon\Desktop\adt-bundle-windows-x86_64-20131030\sdk\build-tools\19.0.3\lib\dx.jar --dex --output=C:\Users\alon\Desktop\stokerApp\Stoker\target\classes.dex C:\Users\alon.m2\repository\com\gith
ub\avianey\facebook-android-api\3.0.0\facebook-android-api-3.0.0.apklib C:\Users\alon.m2\repository\commons-lang\commons-lang\2.2\commons-lang-2.2.jar C:\Users\alon.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar C:\Users\alon.m2\repository\com\google\inject\guice\3.0\guice-3.0-no_aop.jar C:\Users\alon.m2\repository\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar C:\Users\alon.m2\repository\javax\xml\stream\stax-api\1.0-2\stax-api-1.0-2.jar C:\Users\alon.m2\re
pository\javax\xml\bind\jaxb-api\2.1\jaxb-api-2.1.jar C:\Users\alon.m2\repository\com\actionbarsherlock\sample-roboguice\4.4.0\sample-roboguice-4.4.0.jar C:\Users\alon.m2\repository\com\android\support\support-v13\1.1.1\support-v13-1.1.1.jar C:\Users\alon.m2\repository\com\actionbarsherlock\actionbarsherlock\4.4.0\actionbarsherlock-4.4.0.apklib C:\Users\alon.m2\repository\com\google\code\facebookapi\facebook-java-api\3.0.4\facebook-java-api-3.0.4.jar C:\Users\alon\Desktop\stokerApp\Stoker\ta
rget\classes C:\Users\alon.m2\repository\org\roboguice\roboguice\2.0\roboguice-2.0.jar C:\Users\alon.m2\repository\com\sun\xml\bind\jaxb-impl\2.1.9\jaxb-impl-2.1.9.jar C:\Users\alon.m2\repository\com\koushikdutta\async\androidasync\1.2.4\androidasync-1.2.4.jar C:\Users\alon.m2\repository\org\json\json\20080701\json-20080701.jar C:\Users\alon.m2\repository\javax\inject\javax.inject\1\javax.inject-1.jar C:\Users\alon.m2\repository\com\google\android\support-v4\r7\support-v4-r7.jar C:\Users\a
lon.m2\repository\org\jvnet\jaxb2_commons\runtime\0.4.1.5\runtime-0.4.1.5.jar C:\Users\alon.m2\repository\com\github\rtyley\roboguice-sherlock\1.5\roboguice-sherlock-1.5.jar C:\Users\alon.m2\repository\javax\activation\activation\1.1\activation-1.1.jar C:\Users\alon.m2\repository\com\google\code\facebookapi\facebook-java-api-schema\3.0.4\facebook-java-api-schema-3.0.4.jar C:\Users\alon.m2\repository\com\google\code\gson\gson\2.2.4\gson-2.2.4.jar C:\Users\alon.m2\repository\com\google\andro
id\gcm\gcm-server\1.0.2\gcm-server-1.0.2.jar C:\Users\alon.m2\repository\com\koushikdutta\ion\ion\1.2.4\ion-1.2.4.jar C:\Users\alon.m2\repository\com\google\android\gms\google-play-services\14.0.0\google-play-services-14.0.0.jar", Result = 1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:dex (default-dex) on project gs-maven-android:
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
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:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException:
at com.jayway.maven.plugins.android.phase08preparepackage.DexMojo.runDex(DexMojo.java:411)
at com.jayway.maven.plugins.android.phase08preparepackage.DexMojo.execute(DexMojo.java:159)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: com.jayway.maven.plugins.android.ExecutionException: ANDROID-040-001: Could not execute: Command = cmd.exe /X /C ""C:\Program Files\Java\jdk1.7.0_17\jre\bin\java" -Xmx1024M -jar C:\Users\alon\Desktop\adt-bundle-windows-x86_64-20131030\sdk\build-tools\19.0.3\lib\dx.jar --dex --output=C:\Users\alon\Desktop\stokerApp\Stoker\target\classes.dex C:\Users\alon.m2\repository\com\github\avianey\facebook-android-api\3.0.0\facebook-android-api-3.0.0.apklib C:\Users\alon.m2\repository\commons-l
ang\commons-lang\2.2\commons-lang-2.2.jar C:\Users\alon.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar C:\Users\alon.m2\repository\com\google\inject\guice\3.0\guice-3.0-no_aop.jar C:\Users\alon.m2\repository\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar C:\Users\alon.m2\repository\javax\xml\stream\stax-api\1.0-2\stax-api-1.0-2.jar C:\Users\alon.m2\repository\javax\xml\bind\jaxb-api\2.1\jaxb-api-2.1.jar C:\Users\alon.m2\repository\com\actionbarsherlock\sampl
e-roboguice\4.4.0\sample-roboguice-4.4.0.jar C:\Users\alon.m2\repository\com\android\support\support-v13\1.1.1\support-v13-1.1.1.jar C:\Users\alon.m2\repository\com\actionbarsherlock\actionbarsherlock\4.4.0\actionbarsherlock-4.4.0.apklib C:\Users\alon.m2\repository\com\google\code\facebookapi\facebook-java-api\3.0.4\facebook-java-api-3.0.4.jar C:\Users\alon\Desktop\stokerApp\Stoker\target\classes C:\Users\alon.m2\repository\org\roboguice\roboguice\2.0\roboguice-2.0.jar C:\Users\alon.m2\repo
sitory\com\sun\xml\bind\jaxb-impl\2.1.9\jaxb-impl-2.1.9.jar C:\Users\alon.m2\repository\com\koushikdutta\async\androidasync\1.2.4\androidasync-1.2.4.jar C:\Users\alon.m2\repository\org\json\json\20080701\json-20080701.jar C:\Users\alon.m2\repository\javax\inject\javax.inject\1\javax.inject-1.jar C:\Users\alon.m2\repository\com\google\android\support-v4\r7\support-v4-r7.jar C:\Users\alon.m2\repository\org\jvnet\jaxb2_commons\runtime\0.4.1.5\runtime-0.4.1.5.jar C:\Users\alon.m2\repository\co
m\github\rtyley\roboguice-sherlock\1.5\roboguice-sherlock-1.5.jar C:\Users\alon.m2\repository\javax\activation\activation\1.1\activation-1.1.jar C:\Users\alon.m2\repository\com\google\code\facebookapi\facebook-java-api-schema\3.0.4\facebook-java-api-schema-3.0.4.jar C:\Users\alon.m2\repository\com\google\code\gson\gson\2.2.4\gson-2.2.4.jar C:\Users\alon.m2\repository\com\google\android\gcm\gcm-server\1.0.2\gcm-server-1.0.2.jar C:\Users\alon.m2\repository\com\koushikdutta\ion\ion\1.2.4\ion-1
.2.4.jar C:\Users\alon.m2\repository\com\google\android\gms\google-play-services\14.0.0\google-play-services-14.0.0.jar", Result = 1

Samples libraryprojects/libraryprojects-tests fails

<testcase time="0.0780" name="testAndroidAssetsAppear" classname="com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp.MainActivityTest">
  <error type="Test failed to run to completion. Reason" message="">Test failed to run to completion. Reason: 'Instrumentation run failed due to 'java.lang.IllegalAccessError''. Check device logcat for details</error>
</testcase>

And log cat gives:

05-25 15:12:20.799    6166-6166/? E/AndroidRuntime๏น• FATAL EXCEPTION: main
    Process: com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp, PID: 6166
    java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
            at com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp.MainActivity.onCreate(MainActivity.java:32)
            at android.app.Activity.performCreate(Activity.java:5231)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
            at android.app.ActivityThread.access$800(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5017)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
            at dalvik.system.NativeStart.main(Native Method)

This is the same fault that Malachi saw elsewhere and reported in #358

Broken handling of version ranges in 3.8.2

When dependencies are defining version ranges, it does fails with following:

[INFO] Manifest merging disabled. Using project manifest only
[INFO] /home/kpiwko/apps/android-sdk-linux_x86/build-tools/19.0.1/aapt [package, -f, --no-crunch, -I, /home/kpiwko/apps/android-sdk-linux_x86/platforms/android-19/android.jar, -M, /home/kpiwko/devel/mobile/upstream/aerogear-android-cookbook/AndroidManifest.xml, -S, /home/kpiwko/devel/mobile/upstream/aerogear-android-cookbook/res, -S, /home/kpiwko/devel/mobile/upstream/aerogear-android-cookbook/target/unpacked-libs/org.jboss.aerogear_aerogear-android_apklib_1.3.0/res, -S, /home/kpiwko/devel/mobile/upstream/aerogear-android-cookbook/target/unpacked-libs/com.google.android.gms_google-play-services_apklib_13.0.0/res, -A, /home/kpiwko/devel/mobile/upstream/aerogear-android-cookbook/target/generated-sources/combined-assets/assets, -m, -J, /home/kpiwko/devel/mobile/upstream/aerogear-android-cookbook/target/generated-sources/r, --output-text-symbols, /home/kpiwko/devel/mobile/upstream/aerogear-android-cookbook/target, --auto-add-overlay]
Downloading: http://repo.maven.apache.org/maven2/com/google/android/gms/google-play-services/[10,)/google-play-services-[10,).pom
[ERROR] Error when generating sources.
org.apache.maven.plugin.MojoExecutionException: Could not resolve dependencies for com.google.android.gms:google-play-services:apklib:[10,)
        at com.jayway.maven.plugins.android.common.DependencyResolver.getDependenciesFor(DependencyResolver.java:105)
        at com.jayway.maven.plugins.android.common.DependencyResolver.getDependenciesFor(DependencyResolver.java:114)
        at com.jayway.maven.plugins.android.common.DependencyResolver.getDependenciesFor(DependencyResolver.java:64)
        at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateRForApkLibDependency(GenerateSourcesMojo.java:659)
        at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateApkLibRs(GenerateSourcesMojo.java:619)
        at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:218)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        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:317)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for com.google.android.gms:google-play-services:apklib:[10,)
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:335)
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:217)
        at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:288)
        at com.jayway.maven.plugins.android.common.DependencyResolver.getDependenciesFor(DependencyResolver.java:101)
        ... 26 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact com.google.android.gms:google-play-services:pom:[10,) from/to central (http://repo.maven.apache.org/maven2): Illegal character in path at index 80: http://repo.maven.apache.org/maven2/com/google/android/gms/google-play-services/[10,)/google-play-services-[10,).pom
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:459)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:262)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:239)
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:320)
        ... 29 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact com.google.android.gms:google-play-services:pom:[10,) from/to central (http://repo.maven.apache.org/maven2): Illegal character in path at index 80: http://repo.maven.apache.org/maven2/com/google/android/gms/google-play-services/[10,)/google-play-services-[10,).pom
        at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$6.wrap(WagonRepositoryConnector.java:1016)
        at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$6.wrap(WagonRepositoryConnector.java:1004)
        at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:725)
        at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.IllegalArgumentException: Illegal character in path at index 80: http://repo.maven.apache.org/maven2/com/google/android/gms/google-play-services/[10,)/google-play-services-[10,).pom
        at java.net.URI.create(URI.java:859)
        at org.apache.maven.wagon.providers.http.httpclient.client.methods.HttpGet.<init>(HttpGet.java:69)
        at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:871)
        at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
        at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
        at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
        at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:660)
        ... 4 more
Caused by: java.net.URISyntaxException: Illegal character in path at index 80: http://repo.maven.apache.org/maven2/com/google/android/gms/google-play-services/[10,)/google-play-services-[10,).pom
        at java.net.URI$Parser.fail(URI.java:2829)
        at java.net.URI$Parser.checkChars(URI.java:3002)
        at java.net.URI$Parser.parseHierarchical(URI.java:3086)
        at java.net.URI$Parser.parse(URI.java:3034)
        at java.net.URI.<init>(URI.java:595)
        at java.net.URI.create(URI.java:857)
        ... 10 more

This is working fine with versions 3.8.0 and 3.8.1, so it is a regression.

Steps to reproduce:

git clone https://github.com/aerogear/aerogear-android-cookbook.git
cd aerogear-android-cookbook
mvn clean package

Upgrade android-builder

New version of android builder (btw we should use it more :) )

<android.builder.version>0.9.0</android.builder.version>
<android.tools.version>22.7.0</android.tools.version>

"currently not possible since there are dependency conflicts between lint and maven-plugin-api with regards to guava that break the test execution, see DependencyHierarchy analysis in Eclipse, need to investigate more "

a2e Android for Eclipse Luna not able to install?

I downloaded and installed the new JEE Eclipse Luna (and I deleted the current workspace, as well as .eclipse folder in home and the eclipse installation directory) but there are strange problems with m2e Android plugin.
First of all, the Marketplace tells me that Android m2e is already installed, although there is no installation detail about this in the plugins list. So either there is some dirty data in any local directory anywhere on my computer I don't know or there is basically something wrong with the JEE installation of Luna. I cannot uninstall and install it by Marketplace neither. If I try to uninstall it, it tells me "The following solutions are not available - Android for Maven Eclipse 1.0.1. Proceed with the installation(sic!) anyways".

If I try it by "Install new Software", I get

An error occurred while collecting items to be installed
session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
No repository found containing: osgi.bundle,me.gladwell.eclipse.m2e.android,1.0.1
No repository found containing: org.eclipse.update.feature,me.gladwell.eclipse.m2e.android.feature,1.0.1

when using http://rgladwell.github.com/m2e-android/updates/ as repository, but this repo doesn't seem to exist anymore. http://rgladwell.github.io/m2e-android/updates doesn't seem to exist either.

So it seems that the repo information is wrong? Which updates site does Marketplace use?
(Although all this doesn't explain why Eclipse tells me that it's already installed)

Invalid APK files are created

As of ff24142 and https://github.com/jayway/maven-android-plugin-samples/commit/590d4643f938efac2f97a8f8d802b8110445cb4c the build only produces invalid apk files. E.g. you can test this in the samples project with

cd helloflashlight
mvn clean install android:deploy

mvn -V clean install android:deploy
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 05:51:28-0800)
Maven home: /opt/tools/apache-maven-3.0.5
Java version: 1.6.0_65, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.8.5", arch: "x86_64", family: "mac"
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building HelloFlashlight 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ helloflashlight ---
[INFO] Deleting /Volumes/mac-data/dev/github/jayway/maven-android-plugin-samples/helloflashlight/target
[INFO]
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:generate-sources (default-generate-sources) @ helloflashlight ---
[INFO] Extracting libs
[INFO] Generating R file for com.simpligility.android:helloflashlight:apk:1.0.0
[INFO] Adding R gen folder to compile classpath: /Volumes/mac-data/dev/github/jayway/maven-android-plugin-samples/helloflashlight/target/generated-sources/r
[INFO] Adding AIDL gen folder to compile classpath: /Volumes/mac-data/dev/github/jayway/maven-android-plugin-samples/helloflashlight/target/generated-sources/aidl
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ helloflashlight ---
[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Volumes/mac-data/dev/github/jayway/maven-android-plugin-samples/helloflashlight/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ helloflashlight ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding MacRoman, i.e. build is platform dependent!
[INFO] Compiling 3 source files to /Volumes/mac-data/dev/github/jayway/maven-android-plugin-samples/helloflashlight/target/classes
[INFO]
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:proguard (default-proguard) @ helloflashlight ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ helloflashlight ---
[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Volumes/mac-data/dev/github/jayway/maven-android-plugin-samples/helloflashlight/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ helloflashlight ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ helloflashlight ---
[INFO] No tests to run.
[INFO]
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:emma (default-emma) @ helloflashlight ---
[INFO]
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:dex (default-dex) @ helloflashlight ---
[INFO] Convert classes to Dex : /Volumes/mac-data/dev/github/jayway/maven-android-plugin-samples/helloflashlight/target/classes.dex
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ helloflashlight ---
[INFO] Building jar: /Volumes/mac-data/dev/github/jayway/maven-android-plugin-samples/helloflashlight/target/helloflashlight.jar
[INFO]
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:apk (default-apk) @ helloflashlight ---
[INFO] Generating debug apk.
[INFO]
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:internal-pre-integration-test (default-internal-pre-integration-test) @ helloflashlight ---
[INFO] No InstrumentationRunner found - skipping tests
[INFO]
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:internal-integration-test (default-internal-integration-test) @ helloflashlight ---
[INFO] No InstrumentationRunner found - skipping tests
[INFO]
[INFO] --- maven-install-plugin:2.5.1:install (default-install) @ helloflashlight ---
[INFO] Installing /Volumes/mac-data/dev/github/jayway/maven-android-plugin-samples/helloflashlight/target/helloflashlight.apk to /Users/manfred/.m2/repository/com/simpligility/android/helloflashlight/1.0.0/helloflashlight-1.0.0.apk
[INFO] Installing /Volumes/mac-data/dev/github/jayway/maven-android-plugin-samples/helloflashlight/pom.xml to /Users/manfred/.m2/repository/com/simpligility/android/helloflashlight/1.0.0/helloflashlight-1.0.0.pom
[INFO] Installing /Volumes/mac-data/dev/github/jayway/maven-android-plugin-samples/helloflashlight/target/helloflashlight.jar to /Users/manfred/.m2/repository/com/simpligility/android/helloflashlight/1.0.0/helloflashlight-1.0.0.jar
[INFO]
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:deploy (default-cli) @ helloflashlight ---
[INFO] Waiting for initial device list from the Android Debug Bridge
[INFO] android.devicesThreads parameter not set, using a thread for each attached device
[INFO] android.devices parameter not set, using all attached devices
[INFO] Device 03dd80410939aa47_LGE_Nexus5 found.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.914s
[INFO] Finished at: Mon May 26 21:39:59 PDT 2014
[INFO] Final Memory: 18M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.9.0-SNAPSHOT:deploy (default-cli) on project helloflashlight: 03dd80410939aa47_LGE_Nexus5 : Install of /Volumes/mac-data/dev/github/jayway/maven-android-plugin-samples/helloflashlight/target/helloflashlight.apk failed - [INSTALL_FAILED_INVALID_APK] -> [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
[/Users/manfred/dev/github/jayway/maven-android-plugin-samples/helloflashlight] $

It fails with Maven 3.2.1 and 3.0.5 as well as Java 6 and Java7. Running adb also fails

cd target
[/Users/manfred/dev/github/jayway/maven-android-plugin-samples/helloflashlight/target] $adb install helloflashlight.apk
4138 KB/s (14832 bytes in 0.003s)
pkg: /data/local/tmp/helloflashlight.apk
Failure [INSTALL_FAILED_INVALID_APK]

Updating NDK Support

I'm looking through the NDK as part of a refactor with William on issue #360 and I think we can clean this up quite a bit.
I want to make sure we are on the same page before I make any drastic changes. Here's what I'm thinking...

First and foremost, only outputting files under target/ unless the user specifies otherwise.

  • This assumes we eliminate the clearNativeArtifacts parameter.
    • Move artifacts automatically
    • No longer delete directories (rely on mvn clean to wipe out target instead)
  • gitignore and mvn clean become easier to manage

Change NDK_MAKFILE_DIRECTORY to "generated-sources/ndk"

  • result is target/generated-sources/ndk/android_maven_plugin_makefile.mk
  • alternatively it could be target/ndk/build/android_maven_plugin_makefile.mk using ndkBuildDirectory

Change ndkBuildDirectory from project.getBasedir().getAbsolutePath() to "${project.build.directory}/ndk/build"

Change ndkOutputDirectory to "${project.build.directory}/ndk/libs"

Change nativeLibrariesOutputDirectory to "${project.build.directory}/ndk/obj/local"

  • What is the conceptual difference between ndkOutputDirectory and nativeLibrariesOutputDirectory? Do we need both?

java.lang.NoClassDefFoundError with the aapt options --rename-manifest-package and --rename-instrumentation-target-package

What steps will reproduce the problem?

  1. create an Android projet with the android-release archetype available on the link https://github.com/akquinet/android-archetypes

mvn archetype:generate -B -DarchetypeArtifactId=android-release -DarchetypeGroupId=de.akquinet.android.archetypes -DarchetypeVersion=1.0.11 -DgroupId=com.company.demo -DartifactId=demo -Dversion=1.0.0-SNAPSHOT -Dpackage=com.company.demo -Dandroid-plugin-version=3.8.2 -Demulator=default -Dplatform=16
cd demo
mvn clean install => all is ok

  1. In the projet Android, add configuration in the plugin android-maven-plugin :

< renameManifestPackage >${project.groupId}.foo.bar</ renameManifestPackage >

  1. In the projet Android-it, add configuration in the plugin android-maven-plugin :

< renameManifestPackage >${project.groupId}.foo.bar</ renameManifestPackage >
< renameInstrumentationTargetPackage >${project.groupId}.foo.bar</ renameInstrumentationTargetPackage >
< test >
< instrumentationPackage >${project.groupId}.foo.bar</ instrumentationPackage >
</ test >

What is the expected output?

mvn clean verify
...
[INFO] --- android-maven-plugin:3.8.2:internal-integration-test (default-internal-integration-test) @ android-demo-it ---
[INFO] Found 1 devices connected with the Android Debug Bridge
[INFO] android.device parameter not set, using all attached devices
[INFO] Device 4df19dd060da5f81_samsung_GT-I9300 found.
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Running tests for specified test package: com.company.demo.test
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Running instrumentation tests in com.company.demo.test
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Run started: com.company.demo.test, 1 tests:
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Start [1/1]: com.company.demo.test.HelloAndroidActivityTest#testActivity
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : End [1/1]: com.company.demo.test.HelloAndroidActivityTest#testActivity
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Run ended: 632 ms
[INFO] Tests run: 1, Failures: 0, Errors: 0
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Report file written to D:\workshop\Perso\repo\git\perso\android-demo-parent\android-demo-it\target-dev\surefire-reports\TEST-4df19dd060da5f81_samsung_GT-I9300.xml
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] android-demo - Parent ............................. SUCCESS [0.163s]
[INFO] android-demo - Application ........................ SUCCESS [10.197s]
[INFO] android-demo-it - Integration tests ............... SUCCESS [29.012s]
[INFO] ------------------------------------------------------------------------

What do you see instead?

mvn clean verify
...
[INFO] --- android-maven-plugin:3.8.2:internal-integration-test (default-internal-integration-test) @ android-demo-it ---
[INFO] Found 1 devices connected with the Android Debug Bridge
[INFO] android.device parameter not set, using all attached devices
[INFO] Device 4df19dd060da5f81_samsung_GT-I9300 found.
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Running tests for specified test package: com.company.demo.test
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Running instrumentation tests in com.company.demo.dev
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Run started: com.company.demo.dev, 1 tests:
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Start [1/1]: android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests#testSuiteConstructionFailed
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : ERROR:android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests#testSuiteConstructionFailed
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : java.lang.RuntimeException: Exception during suite construction
at android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests.testSuiteConstructionFailed(TestSuiteBuilder.java:238)
at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:554)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1738)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.test.suitebuilder.TestMethod.instantiateTest(TestMethod.java:87)
at android.test.suitebuilder.TestMethod.createTest(TestMethod.java:73)
at android.test.suitebuilder.TestSuiteBuilder.addTest(TestSuiteBuilder.java:262)
at android.test.suitebuilder.TestSuiteBuilder.build(TestSuiteBuilder.java:184)
at android.test.InstrumentationTestRunner.onCreate(InstrumentationTestRunner.java:379)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4675)
at android.app.ActivityThread.access$1400(ActivityThread.java:159)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1376)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5419)
at java.lang.reflect.Method.invokeNative(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NoClassDefFoundError: com.company.demo.HelloAndroidActivity
at com.company.demo.test.HelloAndroidActivityTest.(HelloAndroidActivityTest.java:9)
... 18 more

[INFO] 4df19dd060da5f81_samsung_GT-I9300 : End [1/1]: android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests#testSuiteConstructionFailed
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Run ended: 24 ms
[ERROR] 4df19dd060da5f81_samsung_GT-I9300 : FAILURES!!!
[INFO] Tests run: 1, Failures: 0, Errors: 1
[INFO] 4df19dd060da5f81_samsung_GT-I9300 : Report file written to D:\workshop\Perso\repo\git\perso\android-demo-parent\android-demo-it\target-dev\surefire-reports\TEST-4df19dd060
da5f81_samsung_GT-I9300.xml
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] android-demo - Parent ............................. SUCCESS [0.112s]
[INFO] android-demo - Application ........................ SUCCESS [11.781s]
[INFO] android-demo-it - Integration tests ............... FAILURE [2:26.717s]
[INFO] ------------------------------------------------------------------------

Error :
Caused by: java.lang.NoClassDefFoundError: com.company.demo.HelloAndroidActivity
at com.company.demo.test.HelloAndroidActivityTest.(HelloAndroidActivityTest.java:9)

Except I'm mistaken, the class HelloAndroidActivity should be always found in the package com.company.demo even thouth the manifest package is renamed.

--rename-manifest-package
Rewrite the manifest so that its package name is the package name
given here. Relative class names (for example .Foo) will be
changed to absolute names with the old package so that the code
does not need to change.
--rename-instrumentation-target-package
Rewrite the manifest so that all of its instrumentation
components target the given package. Useful when used in
conjunction with --rename-manifest-package to fix tests against
a package that has been renamed.

What version of maven-android-plugin are you using?

android-maven-plugin:3.8.2

What are the complete output lines of "mvn -version" on your machine?

$ mvn --version
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 17:22:22+0200)
Maven home: d:\bin\apache-maven-3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
Java home: c:\Program Files (x86)\Java\jdk1.7.0_45\jre
Default locale: fr_FR, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"

Please provide any additional information below.

Zipalign has moved from tools to build-tools

To fix it properly we need #303 as some code from the latest library is needed.
AndroidSdk line 196 needs to change

A workaround is to copy the zipalign from build-tools\20.0.0 and put it in tools

mvn clean inside module fails: something to do with DependencyGraph

@william-ferguson-au You might know what's going on with this:

Btw I used the trunk of your maven-shared fork.

Running mvn clean inside a module fails with the following output:

C:\Workspace\maven-android-plugin-samples\morseflash>mvn clean
[INFO] Scanning for projects...
[ERROR] Internal error: java.lang.NullPointerException -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.NullPointerException
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:167)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.NullPointerException
        at org.apache.maven.shared.dependency.graph.internal.DefaultDependencyGraphBuilder.canFindCoreClass(DefaultDependencyGraphBuilder.java:119)
        at org.apache.maven.shared.dependency.graph.internal.DefaultDependencyGraphBuilder.isMaven31(DefaultDependencyGraphBuilder.java:112)
        at org.apache.maven.shared.dependency.graph.internal.DefaultDependencyGraphBuilder.buildDependencyGraph(DefaultDependencyGraphBuilder.java:84)
        at com.jayway.maven.plugins.android.common.DependencyResolver.getProjectDependenciesFor(DependencyResolver.java:48)
        at com.jayway.maven.plugins.android.phase_prebuild.ClasspathModifierLifecycleParticipant.afterProjectsRead(ClasspathModifierLifecycleParticipant.java:80)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
        ... 11 more
[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/InternalErrorException
C:\Workspace\maven-android-plugin-samples\morseflash>

Android Support Library v7: apklib dependency not found in workspace

First, thank you for the project.
I'm trying to integrate the library v7 compatibility using Maven. But my application is not compiling, generating the following error:

dependency=[com.android.support:appcompat-v7:apklib:19.0.1:compile] not found in workspace

I created a question on StackOverflow best detailing context: Question

Problem with 9 patch

I find the problem when creating new styles with 9 patch sources and project has aar dependency it displayed on app not correctly buggy not like it created. When I add this dependency directly through out IDE not maven or exclude 9 patch it works fine. This problem I have in two projects. I guess the problem could be with generating R ids. I tried versions 3.8.0, 3.8.2, 3.9.0-rc everything the same.

Manifest merging with AAR alters APK source file

See this abandoned issue;

<packaging>apk</packaging>
...
<plugin>
  <groupId>com.jayway.maven.plugins.android.generation2</groupId>
  <artifactId>android-maven-plugin</artifactId>
  <configuration>
    <mergeManifests>true</mergeManifests>
...
<dependency>
  <artifactId>the-library</artifactId>
  <type>aar</type>
</dependency>

$ cp src/main/AndroidManifest.xml original
$ mvn package
$ diff src/main/AndroidManifest.xml original | wc -l
111

Expected output: 0

Plugin is from 51f16d5

Edit: I'm using IDEA 13.1.3, but I'm not using it to build.
apk - aar

package name handling for resources changed

I switched from V 3.8.1 to 3.9.0_RC1 and my build failed

I have a base project and an app project. The base is configured to build as apklib. I have some string-resources and some layout-ids defined only in my app-project (i have also defined others in my base ...). With 3.8.1 i was able to use base.R.string.mystring in the app project even if mystring (key and value) exists only in the app and not in the base. Now I have to use app.R.mystring in such cases. Is this a maven-android-plugin bug or was it your plan to fix this strange behaviour?

Overriding layouts are not conflicts

Version: 3.9.0-rc.2

I have doubts about 6247bf3: It's supposed to detect conflicting layouts. I think this is not an error situation at all.

Using this feature of overriding layouts you can provide default layout implementations in an library project and let main projects override them if they want to. We use this in our projects.

Side question: When setting failOnConflictingLayouts to true, will this guarantee to pick the correct layout? With correct layout I refer to the most specific one, e.g. from a main project's layout overrides the library's layout?

Dependency-tree error

@william-ferguson-au does this sounds a bell to you ?

If not I will make a cut down project tomorrow morning.

This project has 2 modules app & espresso

If I comment the espresso module everything is fine.

My guess is that there's a configuration problem in the espresso module

Here is my pom:

<?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.xxxxxx</groupId>
        <artifactId>xxxxxx-parent</artifactId>
        <version>1.0.3-SNAPSHOT</version>
    </parent>
    <artifactId>xxxxxx-espresso-test</artifactId>
    <packaging>apk</packaging>
    <name>xxxxxx - test</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <environment>development</environment>
        <sonar.language>java</sonar.language>
        <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
    </properties>

    <dependencies>
        <dependency>
            <groupId>android</groupId>
            <artifactId>android</artifactId>
            <version>${android.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.android</groupId>
            <artifactId>annotations</artifactId>
            <version>4.1.1.4</version>
            <scope>provided</scope>
        </dependency>
        <!--<dependency>
            <groupId>com.android.support</groupId>
            <artifactId>support-v4</artifactId>
            <version>19.0.1</version>
            <scope>provided</scope>
        </dependency>-->
        <!--<dependency>-->
            <!--<groupId>com.android.support</groupId>-->
            <!--<artifactId>appcompat-v7</artifactId>-->
            <!--<version>19.0.1</version>-->
            <!--<type>aar</type>-->
        <!--</dependency>-->
        <!--<dependency>
            <groupId>com.xxxxx</groupId>
            <artifactId>yyyy-app</artifactId>
            <version>${project.version}</version>
            <type>jar</type>
            <scope>provided</scope>
        </dependency>-->
        <dependency>
            <groupId>com.xxxxx</groupId>
            <artifactId>yyyy-app</artifactId>
            <version>${project.version}</version>
            <type>apk</type>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.google.android.apps.common.testing</groupId>
            <artifactId>espresso</artifactId>
            <version>1.1</version>
        </dependency>
    </dependencies>

    <build>
        <outputDirectory>target/classes</outputDirectory>

        <plugins>
            <plugin>
                <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                <artifactId>android-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <sdk>
                        <platform>${android.api}</platform>
                    </sdk>
                    <extractDuplicates>true</extractDuplicates>
                    <undeployBeforeDeploy>true</undeployBeforeDeploy>
                    <sign>
                        <debug>false</debug>
                    </sign>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>

        </plugins>

    </build>

</project>

Error ouput of mvn clean install --debug

    [DEBUG] Created dummy classes.jar exist=true
[DEBUG] Adding to classpath : D:\Workspace\myproject\module-app\target\unpacked-libs\cgfd_library\classes.jar
[DEBUG] Created dummy classes.jar exist=true
[DEBUG] Adding to classpath : D:\Workspace\myproject\module-app\target\unpacked-libs\nd_android.joda\classes.jar
[DEBUG] Created dummy classes.jar exist=true
[DEBUG] Adding to classpath : D:\Workspace\myproject\module-app\target\unpacked-libs\cas_appcompat-v7\classes.jar
[DEBUG] Created dummy classes.jar exist=true
[DEBUG]
[DEBUG] project=com.xxxxxx:yyyyy-espresso-test:apk:1.0.3-SNAPSHOT
[ERROR] Internal error: java.lang.ClassCastException: org.apache.maven.shared.dependency.graph.internal.Maven31DependencyGraphBuilder cannot be cast to org.apache.maven.shared.dependency.graph.DependencyGraphBuilder -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.ClassCastException: org.apache.maven.shared.dependency.graph.internal.Maven31DependencyGraphBuilder cannot be cast to org.apache.maven.shared.dependency.graph.DependencyGraphBuilder
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:167)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.ClassCastException: org.apache.maven.shared.dependency.graph.internal.Maven31DependencyGraphBuilder cannot be cast to org.apache.maven.shared.dependency.graph.DependencyGraphBuilder
        at org.apache.maven.shared.dependency.graph.internal.DefaultDependencyGraphBuilder.buildDependencyGraph(DefaultDependencyGraphBuilder.java:86)
        at com.jayway.maven.plugins.android.common.DependencyResolver.getProjectDependenciesFor(DependencyResolver.java:45)
        at com.jayway.maven.plugins.android.phase_prebuild.ClasspathModifierLifecycleParticipant.afterProjectsRead(ClasspathModifierLifecycleParticipant.java:87)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
        ... 11 more
[ERROR]

Instrumentation run failed due to 'java.lang.IllegalAccessError'

Hello,

When running instrumentation tests I get the error:

java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation 

There seems to be an issue with compilation or classloader somewhere that depends on the code touched by the test.

To reproduce on morseflash sample project:

Add this line in the onCreate method of ConfigureMorseActivity:

long[] morseCode = MorseCodeConverter.pattern('A');

Run the morseflash-instrumentation project.

Reproduced with 3.8.2, 3.9.0-rc.2 and master (51f16d5)

I found that closed issue #369 should have solved this. Maybe I did something wrong or this is a duplicate of #369.

apklib dependency in another apklib depency is skiped if is used in main project too

Tested with 3.9.0-rc.2

If you have apklib A library which use another apklib B.
And if you use apklib A in your project everything is OK, until you will use apklib B like main project dependency.
Then android maven plugin use it only once in main project and forgot to add it on classpath for building apklib A.

Here is my modification of samples like test case which reproduce this problem
https://github.com/tprochazka/maven-android-plugin-samples/tree/BUG_MISSING_APKLIB_DEP

It fail on

[ERROR] /Users/manfred/tmp/maven-android-plugin-samples/libraryprojects/libraryprojects-apk-with-deps/target/unpacked-libs/cjmpagsl_libraryprojects-apklib-from-apklib/src/com/jayway/maven/plugins/android/generation2/samples/libraryprojects/apklibFromApklib/ApklibFromApklibClass.java:[15,26] cannot find symbol 
  symbol:   variable style 
  location: class com.jayway.maven.plugins.android.generation2.samples.libraryprojects.apklibFromApklib.R 

Lint lombok lib is missing

After upgrading to the new sdk tools

the lombok lib is missing from the tools\lib folder

Workaround: copy the lib before updating and after updating place it there :) "lombok-ast.jar" (it should be version 0.2.2)

A better solution would be to finish #303 and #357

If you already updated your sdk manager the file can be downloaded from here:
http://www.speedyshare.com/GGgfM/lombok-ast.jar

3.9.0-rc.2 creates duplicate aar dependencies with IntelliJ 13.1.3

Cross-posted as http://youtrack.jetbrains.com/issue/IDEA-127048

Build the project attached to the jetbrains bug. When using maven-android-plugin version 3.8.2 everything builds normally. When using version 3.9.0-rc2, a duplicate system dependency for it.sephiroth.android.library.horizontallistview:library:aar:1.1.1 as it.sephiroth.android.library.horizontallistview:library:1.1.1.

This seems related to http://youtrack.jetbrains.com/issue/IDEA-126499 but I'm not sure if it's the same issue.

I suspect this is IntelliJ's fault, but I cross-posted here in case there's something you can do.

This causes the following exception during building:

Error:Android Dex: [jive-android-core-apk] Unable to execute DX  
Error:Android Dex: [jive-android-core-apk] com.android.dex.DexException: Multiple dex files define Lit/sephiroth/android/library/util/MathUtils;  
Error:Android Dex: [jive-android-core-apk] at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594)  
Error:Android Dex: [jive-android-core-apk] at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552)  
Error:Android Dex: [jive-android-core-apk] at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533)  
Error:Android Dex: [jive-android-core-apk] at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170)  
Error:Android Dex: [jive-android-core-apk] at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)  
Error:Android Dex: [jive-android-core-apk] at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)  
Error:Android Dex: [jive-android-core-apk] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)  
Error:Android Dex: [jive-android-core-apk] at com.android.dx.command.dexer.Main.run(Main.java:230)  
Error:Android Dex: [jive-android-core-apk] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
Error:Android Dex: [jive-android-core-apk] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)  
Error:Android Dex: [jive-android-core-apk] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
Error:Android Dex: [jive-android-core-apk] at java.lang.reflect.Method.invoke(Method.java:606)  
Error:Android Dex: [jive-android-core-apk] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:161)  
Error:Android Dex: [jive-android-core-apk] at org.jetbrains.android.compiler.tools.AndroidDxRunner.main(AndroidDxRunner.java:294)  
Error:Android Dex: [jive-android-core-apk] at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:121) 

Generated R file not found when overwrite genDirectory configuration with AAR

Hi,

when I overwrite the genDirectory and try to produce an AAR file, the plugin doesn't find the R file.
ex:
using this configuration in the plugin:
<genDirectory>${project.build.directory}/generated-sources/java</genDirectory</plugin>
execution results in:
ERROR: Unable to open class file [...] generated-sources/r/com/example/test_android_maven/R.java: No such file or directory

dex fails because a BuildConfig class from an aar lib is there twice

What steps will reproduce the problem?

Adding the following lib: https://github.com/jgilfelt/SystemBarTint

<dependency>
    <groupId>com.readystatesoftware.systembartint</groupId>
    <artifactId>systembartint</artifactId>
    <version>1.0.2</version>
    <type>aar</type>
</dependency>

OR the appcompat-v7 lib

<dependency>
  <groupId>com.android.support</groupId>
  <artifactId>appcompat-v7</artifactId>
  <version>19.1.0</version>
  <type>aar</type>
</dependency>

What is the expected output?

Build Success

What do you see instead?

[INFO] UNEXPECTED TOP-LEVEL EXCEPTION:
[INFO] java.lang.IllegalArgumentException: already added: Lcom/readystatesoftware/systembartint/BuildConfig;

What version of maven-android-plugin are you using?

3.9.0-rc.1 & current 3.9.0-SNAPSHOT (2014/04/10)

What are the complete output lines of "mvn -version" on your machine?

3.2.1
java 1.7.0_51

Please provide any additional information below.

In this library the BuildConfig is included in the aar (classes.jar)
But for ActionBarSherlock the BuildConfig is not included in the aar (based on comments in the GenerateSourcesMojo).

Should the aar contain the BuildConfig or should android-maven-plugin generate it or should it check if it needs to generate it or not?

Sample project: https://maven-android-plugin.googlecode.com/issues/attachment?aid=4560002000&name=tictactoe.rar&token=koNVAMhc7WzZFlNalJ57WBs2DEc%3A1397132888054

Previous tracker ticket: 456 https://code.google.com/p/maven-android-plugin/issues/detail?id=456

Test build path at the first position when Update maven project

What steps will reproduce the problem?

  1. create a maven android project
  2. maven -> update maven project

What is the expected output?
Java build path order is
src/main/java at the first.

What do you see instead?
src/test/java at the first.

What version of maven-android-plugin are you using?
3.8.2 and 3.9.0-rc.1

What are the complete output lines of "mvn -version" on your machine?

Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-15T01:37:52+08:00)
Maven home: D:\Program Files\apache-maven-3.2.1\bin..
Java version: 1.6.0_71, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_71\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

Please provide any additional information below.
May be this is not an issue,but it will be cause ADT can't link apklib's resources

dialog

Java Source Attachment Dialog show that android dependies apklib linked the src/test/java

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.