GithubHelp home page GithubHelp logo

Comments (31)

malachid avatar malachid commented on May 20, 2024

simple example here
https://github.com/malachid/bugs/tree/master/maven-android-plugin/issue358

The 'api' depends on Google Play
The 'app' depends on the 'api'
The 'test' instruments the 'app'

The 'test' pom has 3 profiles to choose from showing the different scenarios

from android-maven-plugin.

malachid avatar malachid commented on May 20, 2024

Scenario: APKPROVIDED

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/src/main/java/org/eoti/bugs/mavenandroidplugin/issue358/test/BasicLaunch.java:[9,53] package org.eoti.bugs.mavenandroidplugin.issue358.app does not exist
[ERROR] /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/src/main/java/org/eoti/bugs/mavenandroidplugin/issue358/test/BasicLaunch.java:[14,42] cannot find symbol
  symbol: class Issue358
[ERROR] /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/src/main/java/org/eoti/bugs/mavenandroidplugin/issue358/test/BasicLaunch.java:[33,15] cannot find symbol
  symbol:   class Issue358
  location: class org.eoti.bugs.mavenandroidplugin.issue358.test.BasicLaunch
[ERROR] /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/src/main/java/org/eoti/bugs/mavenandroidplugin/issue358/test/BasicLaunch.java:[21,15] cannot find symbol
  symbol:   class Issue358
  location: class org.eoti.bugs.mavenandroidplugin.issue358.test.BasicLaunch
[ERROR] /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/src/main/java/org/eoti/bugs/mavenandroidplugin/issue358/test/BasicLaunch.java:[27,9] cannot find symbol
  symbol:   class Issue358
  location: class org.eoti.bugs.mavenandroidplugin.issue358.test.BasicLaunch
[ERROR] /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/src/main/java/org/eoti/bugs/mavenandroidplugin/issue358/test/BasicLaunch.java:[34,77] cannot find symbol
  symbol:   class Issue358
  location: class org.eoti.bugs.mavenandroidplugin.issue358.test.BasicLaunch
[ERROR] /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/src/main/java/org/eoti/bugs/mavenandroidplugin/issue358/test/BasicLaunch.java:[36,17] cannot find symbol
  symbol:   class Issue358
  location: class org.eoti.bugs.mavenandroidplugin.issue358.test.BasicLaunch
[INFO] 7 errors 

Scenario: APKRUNTIME

W/dalvikvm( 1631): Class resolved by unexpected DEX: Lorg/eoti/bugs/mavenandroidplugin/issue358/app/Issue358$2;(0x41611fd8):0x1ef970 ref [Lorg/eoti/bugs/mavenandroidplugin/issue358/api/IdHelper;] Lorg/eoti/bugs/mavenandroidplugin/issue358/api/IdHelper;(0x41611fd8):0x18c340
W/dalvikvm( 1631): (Lorg/eoti/bugs/mavenandroidplugin/issue358/app/Issue358$2; had used a different Lorg/eoti/bugs/mavenandroidplugin/issue358/api/IdHelper; during pre-verification)
W/dalvikvm( 1631): threadid=12: thread exiting with uncaught exception (group=0x409c01f8)
E/AndroidRuntime( 1631): FATAL EXCEPTION: Thread-91
E/AndroidRuntime( 1631): java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
E/AndroidRuntime( 1631):    at org.eoti.bugs.mavenandroidplugin.issue358.app.Issue358$2.run(Issue358.java:23)
E/AndroidRuntime( 1631):    at java.lang.Thread.run(Thread.java:856)
W/ActivityManager(  553): Error in app org.eoti.bugs.mavenandroidplugin.issue358.app running instrumentation ComponentInfo{org.eoti.bugs.mavenandroidplugin.issue358.test/android.test.InstrumentationTestRunner}:
W/ActivityManager(  553):   java.lang.IllegalAccessError
W/ActivityManager(  553):   java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
D/AndroidRuntime( 1621): Shutting down VM

Scenario: JARPROVIDED

[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.9.0-SNAPSHOT:apk (default-apk) on project test: Error while processing transitive dependencies: Could not resolve the following dependencies : [org.eoti.bugs.mavenandroidplugin.issue358:api:jar:1.0-SNAPSHOT (system), com.google.android.gms:play-services:jar:4.3.23 (system)]: Could not resolve dependencies for project org.eoti.bugs.mavenandroidplugin.issue358:test:apk:1.0-SNAPSHOT: The following artifacts could not be resolved: org.eoti.bugs.mavenandroidplugin.issue358:api:jar:1.0-SNAPSHOT, com.google.android.gms:play-services:jar:4.3.23: Could not find artifact org.eoti.bugs.mavenandroidplugin.issue358:api:jar:1.0-SNAPSHOT at specified path /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/target/unpacked-libs/oebmi_api/classes.jar -> [Help 1]

from android-maven-plugin.

william-ferguson-au avatar william-ferguson-au commented on May 20, 2024

APKPROVIDED will never work. You are seeing the problem problem as https://code.google.com/p/maven-android-plugin/issues/detail?id=435

If we did allow scope=provided to compile it would fail when running the tests. In 463 it would have failed while running the app. Better to have it fail early and clearly.

APKRUNTIME (NB this is a misnomer. It is really APKCOMPILE, ie scope=compile) works just fine for me.

  1. Cleared local repo
  2. mvn clean install -P APKCOMPILE > apkcompile_out.txt
[INFO] Scanning for projects...
Downloading: http://Insomniac:8081/nexus/content/groups/public/com/jayway/maven/plugins/android/generation2/android-maven-plugin/3.9.0-SNAPSHOT/maven-metadata.xml

Downloading: http://Insomniac:8081/nexus/content/groups/public/org/apache/maven/shared/maven-dependency-tree/2.2-SNAPSHOT/maven-metadata.xml

Downloading: http://Insomniac:8081/nexus/content/groups/public/org/eoti/bugs/mavenandroidplugin/issue358/api/1.0-SNAPSHOT/maven-metadata.xml

Downloading: http://Insomniac:8081/nexus/content/groups/public/org/eoti/bugs/mavenandroidplugin/issue358/api/1.0-SNAPSHOT/api-1.0-SNAPSHOT.aar

Downloading: http://Insomniac:8081/nexus/content/groups/public/org/eoti/bugs/mavenandroidplugin/issue358/app/1.0-SNAPSHOT/maven-metadata.xml

Downloading: http://Insomniac:8081/nexus/content/groups/public/org/eoti/bugs/mavenandroidplugin/issue358/app/1.0-SNAPSHOT/app-1.0-SNAPSHOT.apk

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] issue358
[INFO] api
[INFO] app
[INFO] test
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building issue358 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ issue358 ---
[INFO] 
[INFO] --- maven-dependency-plugin:2.6:copy-dependencies (copy-dependencies) @ issue358 ---
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ issue358 ---
[INFO] Installing d:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\pom.xml to D:\dev\maven-local-repository\org\eoti\bugs\mavenandroidplugin\issue358\1.0-SNAPSHOT\issue358-1.0-SNAPSHOT.pom
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building api 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://Insomniac:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-install-plugin/maven-metadata.xml
592/592 B   

Downloaded: http://Insomniac:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-install-plugin/maven-metadata.xml (592 B at 0.3 KB/sec)
Downloading: http://Insomniac:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-resources-plugin/maven-metadata.xml
686/686 B   

Downloaded: http://Insomniac:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-resources-plugin/maven-metadata.xml (686 B at 0.7 KB/sec)
Downloading: http://Insomniac:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-surefire-plugin/maven-metadata.xml
2/2 KB      

Downloaded: http://Insomniac:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-surefire-plugin/maven-metadata.xml (2 KB at 1.4 KB/sec)
Downloading: http://Insomniac:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml
588/588 B   

Downloaded: http://Insomniac:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml (588 B at 0.6 KB/sec)
Downloading: http://Insomniac:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-deploy-plugin/maven-metadata.xml
678/678 B   

Downloaded: http://Insomniac:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-deploy-plugin/maven-metadata.xml (678 B at 0.7 KB/sec)
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ api ---
[INFO] Deleting D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\api\target
[INFO] 
[INFO] --- maven-dependency-plugin:2.6:copy-dependencies (copy-dependencies) @ api ---
[INFO] Copying support-v4-19.0.1.jar to D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\api\target\dependency\support-v4-19.0.1.jar
[INFO] Copying play-services-4.3.23.aar to D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\api\target\dependency\play-services-4.3.23.aar
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:generate-sources (default-generate-sources) @ api ---
[INFO] Manifest copied from D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\api\src\main\android\AndroidManifest.xml to D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\api\target\AndroidManifest.xml
[INFO] Extracting libs
[INFO] Extracting aar play-services...
[INFO] Getting manifests of dependent apklibs
[INFO] Merging manifests of dependent apklibs
[INFO] Done Merging Manifests of APKLIBs
[INFO] Generating R file for org.eoti.bugs.mavenandroidplugin.issue358:api:aar:1.0-SNAPSHOT
[INFO] Generating R file for aar : com.google.android.gms
[INFO] Adding R gen folder to compile classpath: D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\api\target\generated-sources\r
[INFO] Adding AIDL gen folder to compile classpath: D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\api\target\generated-sources\aidl
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\api\src\main\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ api ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 5 source files to D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\api\target\classes
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:proguard (default-proguard) @ api ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\api\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ api ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ api ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ api ---
[INFO] Building jar: D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\api\target\api-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:aar (default-aar) @ api ---
[INFO] Generating AAR file : api
[INFO] Generating aar
[INFO] Building jar: D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\api\target\api-1.0-SNAPSHOT.aar.classes.jar
[INFO] D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\api\src\main\native does not exist, looking for libraries in target directory.
[INFO] Building zip: D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\api\target\api-1.0-SNAPSHOT.aar
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:aar (aar) @ api ---
[INFO] Generating AAR file : api
[INFO] Generating aar
[INFO] Building jar: D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\api\target\api-1.0-SNAPSHOT.aar.classes.jar
[INFO] D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\api\src\main\native does not exist, looking for libraries in target directory.
[INFO] Building zip: D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\api\target\api-1.0-SNAPSHOT.aar
[INFO] 
[INFO] --- maven-install-plugin:2.5.1:install (default-install) @ api ---
[INFO] Installing D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\api\target\api-1.0-SNAPSHOT.aar to D:\dev\maven-local-repository\org\eoti\bugs\mavenandroidplugin\issue358\api\1.0-SNAPSHOT\api-1.0-SNAPSHOT.aar
[INFO] Installing D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\api\pom.xml to D:\dev\maven-local-repository\org\eoti\bugs\mavenandroidplugin\issue358\api\1.0-SNAPSHOT\api-1.0-SNAPSHOT.pom
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building app 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:undeploy (android-undeploy) @ app ---
[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 025fbd3ae0760048_LGE_Nexus5 found.
[INFO] 025fbd3ae0760048_LGE_Nexus5 :   Successfully uninstalled org.eoti.bugs.mavenandroidplugin.issue358.app
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ app ---
[INFO] Deleting D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\app\target
[INFO] 
[INFO] --- maven-dependency-plugin:2.6:copy-dependencies (copy-dependencies) @ app ---
[INFO] Copying api-1.0-SNAPSHOT.aar to D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\app\target\dependency\api-1.0-SNAPSHOT.aar
[INFO] Copying support-v4-19.0.1.jar to D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\app\target\dependency\support-v4-19.0.1.jar
[INFO] Copying play-services-4.3.23.aar to D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\app\target\dependency\play-services-4.3.23.aar
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:generate-sources (default-generate-sources) @ app ---
[INFO] Manifest copied from D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\app\src\main\android\AndroidManifest.xml to D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\app\target\AndroidManifest.xml
[INFO] Extracting libs
[INFO] Extracting aar api...
[INFO] Extracting aar play-services...
[INFO] Getting manifests of dependent apklibs
[INFO] Merging manifests of dependent apklibs
[INFO] Done Merging Manifests of APKLIBs
[INFO] Generating R file for org.eoti.bugs.mavenandroidplugin.issue358:app:apk:1.0-SNAPSHOT
[INFO] Generating R file for aar : org.eoti.bugs.mavenandroidplugin.issue358.api
[INFO] Generating R file for aar : com.google.android.gms
[INFO] Adding R gen folder to compile classpath: D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\app\target\generated-sources\r
[INFO] Skip BuildConfig.java generation for org.eoti.bugs.mavenandroidplugin.issue358 api
[INFO] Skip BuildConfig.java generation for org.eoti.bugs.mavenandroidplugin.issue358 api
[INFO] Adding AIDL gen folder to compile classpath: D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\app\target\generated-sources\aidl
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ app ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\app\src\main\resources
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ app ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 5 source files to D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\app\target\classes
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:proguard (default-proguard) @ app ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ app ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\app\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ app ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ app ---
[INFO] No tests to run.
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:emma (default-emma) @ app ---
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:dex (default-dex) @ app ---
[INFO] Convert classes to Dex : D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\app\target\classes.dex
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ app ---
[INFO] Building jar: D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\app\target\app-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:apk (default-apk) @ app ---
[INFO] Generating debug apk.
[INFO] Warning: AndroidManifest.xml already defines debuggable (in http://schemas.android.com/apk/res/android); using existing value in manifest.
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:internal-pre-integration-test (default-internal-pre-integration-test) @ app ---
[INFO] No InstrumentationRunner found - skipping tests
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:internal-integration-test (default-internal-integration-test) @ app ---
[INFO] No InstrumentationRunner found - skipping tests
[INFO] 
[INFO] --- maven-install-plugin:2.5.1:install (default-install) @ app ---
[INFO] Installing D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\app\target\app-1.0-SNAPSHOT.apk to D:\dev\maven-local-repository\org\eoti\bugs\mavenandroidplugin\issue358\app\1.0-SNAPSHOT\app-1.0-SNAPSHOT.apk
[INFO] Installing D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\app\pom.xml to D:\dev\maven-local-repository\org\eoti\bugs\mavenandroidplugin\issue358\app\1.0-SNAPSHOT\app-1.0-SNAPSHOT.pom
[INFO] Installing D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\app\target\app-1.0-SNAPSHOT.jar to D:\dev\maven-local-repository\org\eoti\bugs\mavenandroidplugin\issue358\app\1.0-SNAPSHOT\app-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:zipalign (alignApk) @ app ---
[INFO] Skipping zipalign
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:deploy (android-deploy) @ app ---
[INFO] D:\Dev\Android-sdk\build-tools\19.1.0\aapt.exe [dump, xmltree, D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\app\target\app-1.0-SNAPSHOT.apk, AndroidManifest.xml]
[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 025fbd3ae0760048_LGE_Nexus5 found.
[INFO] 025fbd3ae0760048_LGE_Nexus5 :   Successfully uninstalled org.eoti.bugs.mavenandroidplugin.issue358.app
[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 025fbd3ae0760048_LGE_Nexus5 found.
[INFO] 025fbd3ae0760048_LGE_Nexus5 :   Successfully installed D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\app\target\app-1.0-SNAPSHOT.apk
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building test 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ test ---
[INFO] Deleting D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\test\target
[INFO] 
[INFO] --- maven-dependency-plugin:2.6:copy-dependencies (copy-dependencies) @ test ---
[INFO] Copying api-1.0-SNAPSHOT.aar to D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\test\target\dependency\api-1.0-SNAPSHOT.aar
[INFO] Copying app-1.0-SNAPSHOT.apk to D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\test\target\dependency\app-1.0-SNAPSHOT.apk
[INFO] Copying support-v4-19.0.1.jar to D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\test\target\dependency\support-v4-19.0.1.jar
[INFO] Copying play-services-4.3.23.aar to D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\test\target\dependency\play-services-4.3.23.aar
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:generate-sources (default-generate-sources) @ test ---
[INFO] Manifest copied from D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\test\src\main\android\AndroidManifest.xml to D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\test\target\AndroidManifest.xml
[INFO] Extracting libs
[INFO] Extracting apk app...
[INFO] Extracting aar api...
[INFO] Extracting aar play-services...
[INFO] Getting manifests of dependent apklibs
[INFO] Merging manifests of dependent apklibs
[INFO] Done Merging Manifests of APKLIBs
[INFO] Generating R file for org.eoti.bugs.mavenandroidplugin.issue358:test:apk:1.0-SNAPSHOT
[INFO] Generating R file for aar : org.eoti.bugs.mavenandroidplugin.issue358.api
[INFO] Generating R file for aar : com.google.android.gms
[INFO] Adding R gen folder to compile classpath: D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\test\target\generated-sources\r
[INFO] Skip BuildConfig.java generation for org.eoti.bugs.mavenandroidplugin.issue358 api
[INFO] Skip BuildConfig.java generation for org.eoti.bugs.mavenandroidplugin.issue358 api
[INFO] Adding AIDL gen folder to compile classpath: D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\test\target\generated-sources\aidl
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\test\src\main\resources
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ test ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 6 source files to D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\test\target\classes
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:proguard (default-proguard) @ test ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\test\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ test ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ test ---
[INFO] No tests to run.
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:emma (default-emma) @ test ---
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:dex (default-dex) @ test ---
[INFO] Convert classes to Dex : D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\test\target\classes.dex
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ test ---
[INFO] Building jar: D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\test\target\test-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:apk (default-apk) @ test ---
[INFO] Generating debug apk.
[INFO] Warning: AndroidManifest.xml already defines debuggable (in http://schemas.android.com/apk/res/android); using existing value in manifest.
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:internal-pre-integration-test (default-internal-pre-integration-test) @ test ---
[INFO] D:\Dev\Android-sdk\build-tools\19.1.0\aapt.exe [dump, xmltree, D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\app\target\app-1.0-SNAPSHOT.apk, AndroidManifest.xml]
[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 025fbd3ae0760048_LGE_Nexus5 found.
[INFO] 025fbd3ae0760048_LGE_Nexus5 :   Successfully uninstalled org.eoti.bugs.mavenandroidplugin.issue358.app
[INFO] D:\Dev\Android-sdk\build-tools\19.1.0\aapt.exe [dump, xmltree, D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\app\target\app-1.0-SNAPSHOT.apk, AndroidManifest.xml]
[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 025fbd3ae0760048_LGE_Nexus5 found.
[INFO] 025fbd3ae0760048_LGE_Nexus5 :   Successfully uninstalled org.eoti.bugs.mavenandroidplugin.issue358.app
[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 025fbd3ae0760048_LGE_Nexus5 found.
[INFO] 025fbd3ae0760048_LGE_Nexus5 :   Successfully installed D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\app\target\app-1.0-SNAPSHOT.apk
[INFO] D:\Dev\Android-sdk\build-tools\19.1.0\aapt.exe [dump, xmltree, D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\test\target\test-1.0-SNAPSHOT.apk, AndroidManifest.xml]
[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 025fbd3ae0760048_LGE_Nexus5 found.
[INFO] 025fbd3ae0760048_LGE_Nexus5 :   Successfully uninstalled org.eoti.bugs.mavenandroidplugin.issue358.test
[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 025fbd3ae0760048_LGE_Nexus5 found.
[INFO] 025fbd3ae0760048_LGE_Nexus5 :   Successfully installed D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\test\target\test-1.0-SNAPSHOT.apk
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:internal-integration-test (default-internal-integration-test) @ test ---
[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 025fbd3ae0760048_LGE_Nexus5 found.
[INFO] 025fbd3ae0760048_LGE_Nexus5 :   Running instrumentation tests in org.eoti.bugs.mavenandroidplugin.issue358.test
[INFO] 025fbd3ae0760048_LGE_Nexus5 :     Run started: org.eoti.bugs.mavenandroidplugin.issue358.test, 1 tests:
[INFO] 025fbd3ae0760048_LGE_Nexus5 :       Start [1/1]: org.eoti.bugs.mavenandroidplugin.issue358.test.BasicLaunch#testStart
[INFO] 025fbd3ae0760048_LGE_Nexus5 :       End [1/1]: org.eoti.bugs.mavenandroidplugin.issue358.test.BasicLaunch#testStart
[INFO] 025fbd3ae0760048_LGE_Nexus5 :     Run ended: 753 ms
[INFO]   Tests run: 1,  Failures: 0,  Errors: 0
[INFO] 025fbd3ae0760048_LGE_Nexus5 :   Report file written to D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\test\target\surefire-reports\TEST-025fbd3ae0760048_LGE_Nexus5.xml
[INFO] 
[INFO] --- maven-install-plugin:2.5.1:install (default-install) @ test ---
[INFO] Installing D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\test\target\test-1.0-SNAPSHOT.apk to D:\dev\maven-local-repository\org\eoti\bugs\mavenandroidplugin\issue358\test\1.0-SNAPSHOT\test-1.0-SNAPSHOT.apk
[INFO] Installing D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\test\pom.xml to D:\dev\maven-local-repository\org\eoti\bugs\mavenandroidplugin\issue358\test\1.0-SNAPSHOT\test-1.0-SNAPSHOT.pom
[INFO] Installing D:\Source_3rdParty\malachi-bugs\maven-android-plugin\issue358\test\target\test-1.0-SNAPSHOT.jar to D:\dev\maven-local-repository\org\eoti\bugs\mavenandroidplugin\issue358\test\1.0-SNAPSHOT\test-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] issue358 .......................................... SUCCESS [  0.649 s]
[INFO] api ............................................... SUCCESS [  9.371 s]
[INFO] app ............................................... SUCCESS [ 20.707 s]
[INFO] test .............................................. SUCCESS [ 30.209 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:01 min
[INFO] Finished at: 2014-05-20T18:41:33+10:00
[INFO] Final Memory: 30M/395M
[INFO] ------------------------------------------------------------------------

from android-maven-plugin.

malachid avatar malachid commented on May 20, 2024

I don't get a success... changed the name per your comment and:

mvn clean install -P APKCOMPILE 2>&1 | tee build.log

Result:

[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:internal-integration-test (default-internal-integration-test) @ test ---
[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 R32D303E8KF_samsung_Nexus10 found.
[INFO] R32D303E8KF_samsung_Nexus10 :   Running instrumentation tests in org.eoti.bugs.mavenandroidplugin.issue358.test
[INFO] R32D303E8KF_samsung_Nexus10 :     Run started: org.eoti.bugs.mavenandroidplugin.issue358.test, 1 tests:
[INFO] R32D303E8KF_samsung_Nexus10 :       Start [1/1]: org.eoti.bugs.mavenandroidplugin.issue358.test.BasicLaunch#testStart
[INFO] R32D303E8KF_samsung_Nexus10 :       ERROR:org.eoti.bugs.mavenandroidplugin.issue358.test.BasicLaunch#testStart
[INFO] R32D303E8KF_samsung_Nexus10 :       Test failed to run to completion. Reason: 'Instrumentation run failed due to 'java.lang.IllegalAccessError''. Check device logcat for details
[INFO] R32D303E8KF_samsung_Nexus10 :       End [1/1]: org.eoti.bugs.mavenandroidplugin.issue358.test.BasicLaunch#testStart
[INFO] R32D303E8KF_samsung_Nexus10 :     Run failed: Instrumentation run failed due to 'java.lang.IllegalAccessError'
[INFO] R32D303E8KF_samsung_Nexus10 :     Run ended: 0 ms
[ERROR] R32D303E8KF_samsung_Nexus10 :     FAILURES!!!
[INFO]   Tests run: 1,  Failures: 0,  Errors: 1
[INFO] R32D303E8KF_samsung_Nexus10 :   Report file written to /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/target/surefire-reports/TEST-R32D303E8KF_samsung_Nexus10.xml
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] issue358 .......................................... SUCCESS [0.644s]
[INFO] api ............................................... SUCCESS [17.333s]
[INFO] app ............................................... SUCCESS [18.918s]
[INFO] test .............................................. FAILURE [24.785s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:18.808s
[INFO] Finished at: Tue May 20 10:08:57 PDT 2014
[INFO] Final Memory: 30M/615M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.9.0-SNAPSHOT:internal-integration-test (default-internal-integration-test) on project test: R32D303E8KF_samsung_Nexus10 :   Tests failed on device. -> [Help 1]
[ERROR] 

adb logcat shows:

D/dalvikvm( 3145): GC_CONCURRENT freed 455K, 19% free 3609K/4428K, paused 2ms+1ms, total 12ms
D/dalvikvm( 3145): WAIT_FOR_CONCURRENT_GC blocked 4ms
D/dalvikvm( 3145): GC_CONCURRENT freed 349K, 15% free 3769K/4428K, paused 2ms+1ms, total 11ms
D/dalvikvm( 3145): GC_CONCURRENT freed 728K, 20% free 3552K/4428K, paused 1ms+1ms, total 13ms
D/dalvikvm( 3145): WAIT_FOR_CONCURRENT_GC blocked 9ms
D/dalvikvm( 3145): GC_CONCURRENT freed 354K, 17% free 3710K/4428K, paused 2ms+2ms, total 16ms
D/dalvikvm( 3145): WAIT_FOR_CONCURRENT_GC blocked 5ms
D/dalvikvm( 3145): GC_CONCURRENT freed 353K, 13% free 3869K/4428K, paused 1ms+2ms, total 13ms
D/dalvikvm( 3145): WAIT_FOR_CONCURRENT_GC blocked 5ms
D/dalvikvm( 3145): GC_CONCURRENT freed 702K, 18% free 3670K/4456K, paused 2ms+1ms, total 14ms
D/dalvikvm( 3145): WAIT_FOR_CONCURRENT_GC blocked 8ms
I/TestRunner( 3145): started: testStart(org.eoti.bugs.mavenandroidplugin.issue358.test.BasicLaunch)
I/ActivityManager(  443): START u0 {flg=0x10000000 cmp=org.eoti.bugs.mavenandroidplugin.issue358.app/.Issue358} from pid 3145
D/dalvikvm( 3145): GC_CONCURRENT freed 516K, 20% free 3565K/4456K, paused 2ms+2ms, total 20ms
W/dalvikvm( 3145): Class resolved by unexpected DEX: Lorg/eoti/bugs/mavenandroidplugin/issue358/app/Issue358$2;(0x418eb968):0x759be000 ref [Lorg/eoti/bugs/mavenandroidplugin/issue358/api/IdHelper;] Lorg/eoti/bugs/mavenandroidplugin/issue358/api/IdHelper;(0x418eb968):0x756d5000
W/dalvikvm( 3145): (Lorg/eoti/bugs/mavenandroidplugin/issue358/app/Issue358$2; had used a different Lorg/eoti/bugs/mavenandroidplugin/issue358/api/IdHelper; during pre-verification)
W/dalvikvm( 3145): threadid=12: thread exiting with uncaught exception (group=0x415e2ba8)
E/AndroidRuntime( 3145): FATAL EXCEPTION: Thread-244
E/AndroidRuntime( 3145): Process: org.eoti.bugs.mavenandroidplugin.issue358.app, PID: 3145
E/AndroidRuntime( 3145): java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
E/AndroidRuntime( 3145):    at org.eoti.bugs.mavenandroidplugin.issue358.app.Issue358$2.run(Issue358.java:23)
E/AndroidRuntime( 3145):    at java.lang.Thread.run(Thread.java:841)
D/AndroidRuntime( 3134): Shutting down VM
D/dalvikvm( 3134): GC_CONCURRENT freed 102K, 16% free 567K/672K, paused 0ms+0ms, total 2ms
W/ActivityManager(  443): Error in app org.eoti.bugs.mavenandroidplugin.issue358.app running instrumentation ComponentInfo{org.eoti.bugs.mavenandroidplugin.issue358.test/android.test.InstrumentationTestRunner}:
W/ActivityManager(  443):   java.lang.IllegalAccessError
W/ActivityManager(  443):   java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
I/ActivityManager(  443): Force stopping org.eoti.bugs.mavenandroidplugin.issue358.app appid=10198 user=0: finished inst
I/ActivityManager(  443): Killing 3145:org.eoti.bugs.mavenandroidplugin.issue358.app/u0a198 (adj 0): stop org.eoti.bugs.mavenandroidplugin.issue358.app
I/ActivityManager(  443):   Force finishing activity ActivityRecord{418e03c8 u0 org.eoti.bugs.mavenandroidplugin.issue358.app/.Issue358 t2}
W/InputDispatcher(  443): channel '41f473b8 org.eoti.bugs.mavenandroidplugin.issue358.app/org.eoti.bugs.mavenandroidplugin.issue358.app.Issue358 (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
E/InputDispatcher(  443): channel '41f473b8 org.eoti.bugs.mavenandroidplugin.issue358.app/org.eoti.bugs.mavenandroidplugin.issue358.app.Issue358 (server)' ~ Channel is unrecoverably broken and will be disposed!
W/InputDispatcher(  443): Attempted to unregister already unregistered input channel '41f473b8 org.eoti.bugs.mavenandroidplugin.issue358.app/org.eoti.bugs.mavenandroidplugin.issue358.app.Issue358 (server)'
D/mali_winsys(  658): new_window_surface returns 0x3000
I/WindowState(  443): WIN DEATH: Window{41f473b8 u0 org.eoti.bugs.mavenandroidplugin.issue358.app/org.eoti.bugs.mavenandroidplugin.issue358.app.Issue358}
W/InputMethodManagerService(  443): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@42070eb8 attribute=null, token = android.os.BinderProxy@4209e470
D/Finsky  ( 1399): [1] 5.onFinished: Installation state replication succeeded.

from android-maven-plugin.

malachid avatar malachid commented on May 20, 2024

note -P JARPROVIDED works with 3.9.0-rc.1 but not with 3.9.0-SNAPSHOT

from android-maven-plugin.

malachid avatar malachid commented on May 20, 2024

Tried both:

Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 08:22:22-0700)
Maven home: /usr/local/maven
Java version: 1.7.0_55, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-24-generic", arch: "amd64", family: "unix"

and:

Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T09:37:52-08:00)

from android-maven-plugin.

william-ferguson-au avatar william-ferguson-au commented on May 20, 2024

I'm not sure what to suggest Malachi.
Reading through these:
https://groups.google.com/forum/#!topic/android-platform/IP9BuSXgTdQ

http://stackoverflow.com/questions/22193668/class-resolved-by-unexpected-dex
suggests that you have org/eoti/bugs/mavenandroidplugin/issue358/api/IdHelper
being DEXed and loaded twice.

Can I suggest uninstalling the apps from Nexus10 first, cleaning out your
local repo and building again clean (directly from your GIT repo - without
changes).

On Wed, May 21, 2014 at 3:10 AM, Malachi de AElfweald <
[email protected]> wrote:

I don't get a success... changed the name per your comment and:

mvn clean install -P APKCOMPILE 2>&1 | tee build.log

Result:

android-maven-plugin:3.9.0-SNAPSHOT:internal-integration-test
(default-internal-integration-test) @ test ---
[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 R32D303E8KF_samsung_Nexus10 found.
[INFO] R32D303E8KF_samsung_Nexus10 : Running instrumentation tests in
org.eoti.bugs.mavenandroidplugin.issue358.test
[INFO] R32D303E8KF_samsung_Nexus10 : Run started:
org.eoti.bugs.mavenandroidplugin.issue358.test, 1 tests:
[INFO] R32D303E8KF_samsung_Nexus10 : Start [1/1]:
org.eoti.bugs.mavenandroidplugin.issue358.test.BasicLaunch#testStart
[INFO] R32D303E8KF_samsung_Nexus10 :
ERROR:org.eoti.bugs.mavenandroidplugin.issue358.test.BasicLaunch#testStart
[INFO] R32D303E8KF_samsung_Nexus10 : Test failed to run to completion.
Reason: 'Instrumentation run failed due to 'java.lang.IllegalAccessError''.
Check device logcat for details
[INFO] R32D303E8KF_samsung_Nexus10 : End [1/1]:
org.eoti.bugs.mavenandroidplugin.issue358.test.BasicLaunch#testStart
[INFO] R32D303E8KF_samsung_Nexus10 : Run failed: Instrumentation run
failed due to 'java.lang.IllegalAccessError'
[INFO] R32D303E8KF_samsung_Nexus10 : Run ended: 0 ms
[ERROR] R32D303E8KF_samsung_Nexus10 : FAILURES!!!
[INFO] Tests run: 1, Failures: 0, Errors: 1
[INFO] R32D303E8KF_samsung_Nexus10 : Report file written to
/home/malachi/work/public/bugs/maven-android-plugin/issue358/test/target/surefire-reports/TEST-R32D303E8KF_samsung_Nexus10.xml

## [INFO]

[INFO] Reactor Summary:
[INFO]
[INFO] issue358 .......................................... SUCCESS [0.644s]
[INFO] api ............................................... SUCCESS
[17.333s]
[INFO] app ............................................... SUCCESS
[18.918s]
[INFO] test .............................................. FAILURE
[24.785s]

## [INFO]

[INFO] BUILD FAILURE

## [INFO]

[INFO] Total time: 1:18.808s
[INFO] Finished at: Tue May 20 10:08:57 PDT 2014
[INFO] Final Memory: 30M/615M

## [INFO]

[ERROR] Failed to execute goal
com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.9.0-SNAPSHOT:internal-integration-test
(default-internal-integration-test) on project test:
R32D303E8KF_samsung_Nexus10 : Tests failed on device. -> [Help 1]
[ERROR]

adb logcat shows:

D/dalvikvm( 3145): GC_CONCURRENT freed 455K, 19% free 3609K/4428K, paused
2ms+1ms, total 12ms
D/dalvikvm( 3145): WAIT_FOR_CONCURRENT_GC blocked 4ms
D/dalvikvm( 3145): GC_CONCURRENT freed 349K, 15% free 3769K/4428K, paused
2ms+1ms, total 11ms
D/dalvikvm( 3145): GC_CONCURRENT freed 728K, 20% free 3552K/4428K, paused
1ms+1ms, total 13ms
D/dalvikvm( 3145): WAIT_FOR_CONCURRENT_GC blocked 9ms
D/dalvikvm( 3145): GC_CONCURRENT freed 354K, 17% free 3710K/4428K, paused
2ms+2ms, total 16ms
D/dalvikvm( 3145): WAIT_FOR_CONCURRENT_GC blocked 5ms
D/dalvikvm( 3145): GC_CONCURRENT freed 353K, 13% free 3869K/4428K, paused
1ms+2ms, total 13ms
D/dalvikvm( 3145): WAIT_FOR_CONCURRENT_GC blocked 5ms
D/dalvikvm( 3145): GC_CONCURRENT freed 702K, 18% free 3670K/4456K, paused
2ms+1ms, total 14ms
D/dalvikvm( 3145): WAIT_FOR_CONCURRENT_GC blocked 8ms
I/TestRunner( 3145): started:
testStart(org.eoti.bugs.mavenandroidplugin.issue358.test.BasicLaunch)
I/ActivityManager( 443): START u0 {flg=0x10000000
cmp=org.eoti.bugs.mavenandroidplugin.issue358.app/.Issue358} from pid 3145
D/dalvikvm( 3145): GC_CONCURRENT freed 516K, 20% free 3565K/4456K, paused
2ms+2ms, total 20ms
W/dalvikvm( 3145): Class resolved by unexpected DEX:
Lorg/eoti/bugs/mavenandroidplugin/issue358/app/Issue358$2;(0x418eb968):0x759be000
ref [Lorg/eoti/bugs/mavenandroidplugin/issue358/api/IdHelper;]
Lorg/eoti/bugs/mavenandroidplugin/issue358/api/IdHelper;(0x418eb968):0x756d5000
W/dalvikvm( 3145):
(Lorg/eoti/bugs/mavenandroidplugin/issue358/app/Issue358$2; had used a
different Lorg/eoti/bugs/mavenandroidplugin/issue358/api/IdHelper; during
pre-verification)
W/dalvikvm( 3145): threadid=12: thread exiting with uncaught exception
(group=0x415e2ba8)
E/AndroidRuntime( 3145): FATAL EXCEPTION: Thread-244
E/AndroidRuntime( 3145): Process:
org.eoti.bugs.mavenandroidplugin.issue358.app, PID: 3145
E/AndroidRuntime( 3145): java.lang.IllegalAccessError: Class ref in
pre-verified class resolved to unexpected implementation
E/AndroidRuntime( 3145): at
org.eoti.bugs.mavenandroidplugin.issue358.app.Issue358$2.run(Issue358.java:23)
E/AndroidRuntime( 3145): at java.lang.Thread.run(Thread.java:841)
D/AndroidRuntime( 3134): Shutting down VM
D/dalvikvm( 3134): GC_CONCURRENT freed 102K, 16% free 567K/672K, paused
0ms+0ms, total 2ms
W/ActivityManager( 443): Error in app
org.eoti.bugs.mavenandroidplugin.issue358.app running instrumentation
ComponentInfo{org.eoti.bugs.mavenandroidplugin.issue358.test/android.test.InstrumentationTestRunner}:
W/ActivityManager( 443): java.lang.IllegalAccessError
W/ActivityManager( 443): java.lang.IllegalAccessError: Class ref in
pre-verified class resolved to unexpected implementation
I/ActivityManager( 443): Force stopping
org.eoti.bugs.mavenandroidplugin.issue358.app appid=10198 user=0: finished
inst
I/ActivityManager( 443): Killing
3145:org.eoti.bugs.mavenandroidplugin.issue358.app/u0a198 (adj 0): stop
org.eoti.bugs.mavenandroidplugin.issue358.app
I/ActivityManager( 443): Force finishing activity ActivityRecord{418e03c8
u0 org.eoti.bugs.mavenandroidplugin.issue358.app/.Issue358 t2}
W/InputDispatcher( 443): channel '41f473b8
org.eoti.bugs.mavenandroidplugin.issue358.app/org.eoti.bugs.mavenandroidplugin.issue358.app.Issue358
(server)' ~ Consumer closed input channel or an error occurred. events=0x9
E/InputDispatcher( 443): channel '41f473b8
org.eoti.bugs.mavenandroidplugin.issue358.app/org.eoti.bugs.mavenandroidplugin.issue358.app.Issue358
(server)' ~ Channel is unrecoverably broken and will be disposed!
W/InputDispatcher( 443): Attempted to unregister already unregistered
input channel '41f473b8
org.eoti.bugs.mavenandroidplugin.issue358.app/org.eoti.bugs.mavenandroidplugin.issue358.app.Issue358
(server)'
D/mali_winsys( 658): new_window_surface returns 0x3000
I/WindowState( 443): WIN DEATH: Window{41f473b8 u0
org.eoti.bugs.mavenandroidplugin.issue358.app/org.eoti.bugs.mavenandroidplugin.issue358.app.Issue358}
W/InputMethodManagerService( 443): Window already focused, ignoring focus
gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@42070eb8attribute=null, token =
android.os.BinderProxy@4209e47https://github.com/android.os.BinderProxy/maven-android-plugin/commit/4209e470
D/Finsky ( 1399): [1] 5.onFinished: Installation state replication
succeeded.

—
Reply to this email directly or view it on GitHubhttps://github.com/jayway/maven-android-plugin/issues/358#issuecomment-43655419
.

from android-maven-plugin.

malachid avatar malachid commented on May 20, 2024

From what I can tell:

  1. if the apk is specified as 'provided', it can't find the classes and the test/target/unpacked-libs/oebmi_api/ doesn't exist

  2. if the apk is not specified as 'provided', it does find the classes - twice - because that test/target/unpacked-libs/oebmi_api/classes.jar gets redexed

I'm normally doing 'mvn clean install' with undeploy attached to clean and deploy attached to install; but did a removal from the device Settings menu instead.

did: rm -rf ~/.m2/repository/org/eoti/bugs
did a fresh git pull
then: mvn clean install -P APKCOMPILE 2>&1 | tee build.log

[WARNING] 
[WARNING] Some problems were encountered while building the effective settings
[WARNING] 'servers.server.id' must be unique but found duplicate server with id android.repo @ /home/malachi/.m2/settings.xml
[WARNING] 
[INFO] Scanning for projects...
Downloading: https://nexus.playhaven.com/nexus/content/groups/public/com/jayway/maven/plugins/android/generation2/android-maven-plugin/3.9.0-SNAPSHOT/maven-metadata.xml
814/814 B   

Downloaded: https://nexus.playhaven.com/nexus/content/groups/public/com/jayway/maven/plugins/android/generation2/android-maven-plugin/3.9.0-SNAPSHOT/maven-metadata.xml (814 B at 0.2 KB/sec)
Downloading: https://nexus.playhaven.com/nexus/content/groups/public/org/apache/maven/shared/maven-dependency-tree/2.2-SNAPSHOT/maven-metadata.xml

Downloading: https://nexus.playhaven.com/nexus/content/groups/public/org/eoti/bugs/mavenandroidplugin/issue358/api/1.0-SNAPSHOT/maven-metadata.xml

Downloading: https://nexus.playhaven.com/nexus/content/groups/public/org/eoti/bugs/mavenandroidplugin/issue358/api/1.0-SNAPSHOT/api-1.0-SNAPSHOT.aar

Downloading: https://nexus.playhaven.com/nexus/content/groups/public/org/eoti/bugs/mavenandroidplugin/issue358/app/1.0-SNAPSHOT/maven-metadata.xml

Downloading: https://nexus.playhaven.com/nexus/content/groups/public/org/eoti/bugs/mavenandroidplugin/issue358/app/1.0-SNAPSHOT/app-1.0-SNAPSHOT.apk

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] issue358
[INFO] api
[INFO] app
[INFO] test
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building issue358 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ issue358 ---
[INFO] 
[INFO] --- maven-dependency-plugin:2.6:copy-dependencies (copy-dependencies) @ issue358 ---
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ issue358 ---
[INFO] Installing /home/malachi/work/public/bugs/maven-android-plugin/issue358/pom.xml to /home/malachi/.m2/repository/org/eoti/bugs/mavenandroidplugin/issue358/1.0-SNAPSHOT/issue358-1.0-SNAPSHOT.pom
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building api 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://nexus.playhaven.com/nexus/content/groups/public/org/apache/maven/plugins/maven-install-plugin/maven-metadata.xml

Downloading: https://nexus.playhaven.com/nexus/content/groups/public/org/apache/maven/plugins/maven-resources-plugin/maven-metadata.xml

Downloading: https://nexus.playhaven.com/nexus/content/groups/public/org/apache/maven/plugins/maven-surefire-plugin/maven-metadata.xml

Downloading: https://nexus.playhaven.com/nexus/content/groups/public/org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml

Downloading: https://nexus.playhaven.com/nexus/content/groups/public/org/apache/maven/plugins/maven-deploy-plugin/maven-metadata.xml

[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ api ---
[INFO] Deleting /home/malachi/work/public/bugs/maven-android-plugin/issue358/api/target
[INFO] 
[INFO] --- maven-dependency-plugin:2.6:copy-dependencies (copy-dependencies) @ api ---
[INFO] Copying support-v4-19.0.1.jar to /home/malachi/work/public/bugs/maven-android-plugin/issue358/api/target/dependency/support-v4-19.0.1.jar
[INFO] Copying play-services-4.3.23.aar to /home/malachi/work/public/bugs/maven-android-plugin/issue358/api/target/dependency/play-services-4.3.23.aar
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:generate-sources (default-generate-sources) @ api ---
[INFO] Manifest copied from /home/malachi/work/public/bugs/maven-android-plugin/issue358/api/src/main/android/AndroidManifest.xml to /home/malachi/work/public/bugs/maven-android-plugin/issue358/api/target/AndroidManifest.xml
[INFO] Extracting libs
[INFO] Extracting aar play-services...
[INFO] Getting manifests of dependent apklibs
[INFO] Merging manifests of dependent apklibs
[INFO] Done Merging Manifests of APKLIBs
[INFO] Generating R file for org.eoti.bugs.mavenandroidplugin.issue358:api:aar:1.0-SNAPSHOT
[INFO] Generating R file for aar : com.google.android.gms
[INFO] Adding R gen folder to compile classpath: /home/malachi/work/public/bugs/maven-android-plugin/issue358/api/target/generated-sources/r
[INFO] Adding AIDL gen folder to compile classpath: /home/malachi/work/public/bugs/maven-android-plugin/issue358/api/target/generated-sources/aidl
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/malachi/work/public/bugs/maven-android-plugin/issue358/api/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ api ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 5 source files to /home/malachi/work/public/bugs/maven-android-plugin/issue358/api/target/classes
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:proguard (default-proguard) @ api ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/malachi/work/public/bugs/maven-android-plugin/issue358/api/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ api ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ api ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ api ---
[INFO] Building jar: /home/malachi/work/public/bugs/maven-android-plugin/issue358/api/target/api-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:aar (default-aar) @ api ---
[INFO] Generating AAR file : api
[INFO] Generating aar
[INFO] Building jar: /home/malachi/work/public/bugs/maven-android-plugin/issue358/api/target/api-1.0-SNAPSHOT.aar.classes.jar
[INFO] /home/malachi/work/public/bugs/maven-android-plugin/issue358/api/src/main/native does not exist, looking for libraries in target directory.
[INFO] Building zip: /home/malachi/work/public/bugs/maven-android-plugin/issue358/api/target/api-1.0-SNAPSHOT.aar
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:aar (aar) @ api ---
[INFO] Generating AAR file : api
[INFO] Generating aar
[INFO] Building jar: /home/malachi/work/public/bugs/maven-android-plugin/issue358/api/target/api-1.0-SNAPSHOT.aar.classes.jar
[INFO] /home/malachi/work/public/bugs/maven-android-plugin/issue358/api/src/main/native does not exist, looking for libraries in target directory.
[INFO] Building zip: /home/malachi/work/public/bugs/maven-android-plugin/issue358/api/target/api-1.0-SNAPSHOT.aar
[INFO] 
[INFO] --- maven-install-plugin:2.5.1:install (default-install) @ api ---
[INFO] Installing /home/malachi/work/public/bugs/maven-android-plugin/issue358/api/target/api-1.0-SNAPSHOT.aar to /home/malachi/.m2/repository/org/eoti/bugs/mavenandroidplugin/issue358/api/1.0-SNAPSHOT/api-1.0-SNAPSHOT.aar
[INFO] Installing /home/malachi/work/public/bugs/maven-android-plugin/issue358/api/pom.xml to /home/malachi/.m2/repository/org/eoti/bugs/mavenandroidplugin/issue358/api/1.0-SNAPSHOT/api-1.0-SNAPSHOT.pom
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building app 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:undeploy (android-undeploy) @ app ---
[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 R32D303E8KF_samsung_Nexus10 found.
[INFO] R32D303E8KF_samsung_Nexus10 :   Successfully uninstalled org.eoti.bugs.mavenandroidplugin.issue358.app
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ app ---
[INFO] Deleting /home/malachi/work/public/bugs/maven-android-plugin/issue358/app/target
[INFO] 
[INFO] --- maven-dependency-plugin:2.6:copy-dependencies (copy-dependencies) @ app ---
[INFO] Copying api-1.0-SNAPSHOT.aar to /home/malachi/work/public/bugs/maven-android-plugin/issue358/app/target/dependency/api-1.0-SNAPSHOT.aar
[INFO] Copying support-v4-19.0.1.jar to /home/malachi/work/public/bugs/maven-android-plugin/issue358/app/target/dependency/support-v4-19.0.1.jar
[INFO] Copying play-services-4.3.23.aar to /home/malachi/work/public/bugs/maven-android-plugin/issue358/app/target/dependency/play-services-4.3.23.aar
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:generate-sources (default-generate-sources) @ app ---
[INFO] Manifest copied from /home/malachi/work/public/bugs/maven-android-plugin/issue358/app/src/main/android/AndroidManifest.xml to /home/malachi/work/public/bugs/maven-android-plugin/issue358/app/target/AndroidManifest.xml
[INFO] Extracting libs
[INFO] Extracting aar api...
[INFO] Extracting aar play-services...
[INFO] Getting manifests of dependent apklibs
[INFO] Merging manifests of dependent apklibs
[INFO] Done Merging Manifests of APKLIBs
[INFO] Generating R file for org.eoti.bugs.mavenandroidplugin.issue358:app:apk:1.0-SNAPSHOT
[INFO] Generating R file for aar : org.eoti.bugs.mavenandroidplugin.issue358.api
[INFO] Generating R file for aar : com.google.android.gms
[INFO] Adding R gen folder to compile classpath: /home/malachi/work/public/bugs/maven-android-plugin/issue358/app/target/generated-sources/r
[INFO] Skip BuildConfig.java generation for org.eoti.bugs.mavenandroidplugin.issue358 api
[INFO] Skip BuildConfig.java generation for org.eoti.bugs.mavenandroidplugin.issue358 api
[INFO] Adding AIDL gen folder to compile classpath: /home/malachi/work/public/bugs/maven-android-plugin/issue358/app/target/generated-sources/aidl
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ app ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/malachi/work/public/bugs/maven-android-plugin/issue358/app/src/main/resources
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ app ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 5 source files to /home/malachi/work/public/bugs/maven-android-plugin/issue358/app/target/classes
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:proguard (default-proguard) @ app ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ app ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/malachi/work/public/bugs/maven-android-plugin/issue358/app/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ app ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ app ---
[INFO] No tests to run.
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:emma (default-emma) @ app ---
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:dex (default-dex) @ app ---
[INFO] Convert classes to Dex : /home/malachi/work/public/bugs/maven-android-plugin/issue358/app/target/classes.dex
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ app ---
[INFO] Building jar: /home/malachi/work/public/bugs/maven-android-plugin/issue358/app/target/app-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:apk (default-apk) @ app ---
[INFO] Generating debug apk.
[INFO] Warning: AndroidManifest.xml already defines debuggable (in http://schemas.android.com/apk/res/android); using existing value in manifest.
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:internal-pre-integration-test (default-internal-pre-integration-test) @ app ---
[INFO] No InstrumentationRunner found - skipping tests
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:internal-integration-test (default-internal-integration-test) @ app ---
[INFO] No InstrumentationRunner found - skipping tests
[INFO] 
[INFO] --- maven-install-plugin:2.5.1:install (default-install) @ app ---
[INFO] Installing /home/malachi/work/public/bugs/maven-android-plugin/issue358/app/target/app-1.0-SNAPSHOT.apk to /home/malachi/.m2/repository/org/eoti/bugs/mavenandroidplugin/issue358/app/1.0-SNAPSHOT/app-1.0-SNAPSHOT.apk
[INFO] Installing /home/malachi/work/public/bugs/maven-android-plugin/issue358/app/pom.xml to /home/malachi/.m2/repository/org/eoti/bugs/mavenandroidplugin/issue358/app/1.0-SNAPSHOT/app-1.0-SNAPSHOT.pom
[INFO] Installing /home/malachi/work/public/bugs/maven-android-plugin/issue358/app/target/app-1.0-SNAPSHOT.jar to /home/malachi/.m2/repository/org/eoti/bugs/mavenandroidplugin/issue358/app/1.0-SNAPSHOT/app-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:zipalign (alignApk) @ app ---
[INFO] Skipping zipalign
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:deploy (android-deploy) @ app ---
[INFO] /usr/local/android-sdk-linux/build-tools/19.0.3/aapt [dump, xmltree, /home/malachi/work/public/bugs/maven-android-plugin/issue358/app/target/app-1.0-SNAPSHOT.apk, AndroidManifest.xml]
[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 R32D303E8KF_samsung_Nexus10 found.
[INFO] R32D303E8KF_samsung_Nexus10 :   Successfully uninstalled org.eoti.bugs.mavenandroidplugin.issue358.app
[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 R32D303E8KF_samsung_Nexus10 found.
[INFO] R32D303E8KF_samsung_Nexus10 :   Successfully installed /home/malachi/work/public/bugs/maven-android-plugin/issue358/app/target/app-1.0-SNAPSHOT.apk
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building test 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ test ---
[INFO] Deleting /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/target
[INFO] 
[INFO] --- maven-dependency-plugin:2.6:copy-dependencies (copy-dependencies) @ test ---
[INFO] Copying api-1.0-SNAPSHOT.aar to /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/target/dependency/api-1.0-SNAPSHOT.aar
[INFO] Copying app-1.0-SNAPSHOT.apk to /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/target/dependency/app-1.0-SNAPSHOT.apk
[INFO] Copying support-v4-19.0.1.jar to /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/target/dependency/support-v4-19.0.1.jar
[INFO] Copying play-services-4.3.23.aar to /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/target/dependency/play-services-4.3.23.aar
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:generate-sources (default-generate-sources) @ test ---
[INFO] Manifest copied from /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/src/main/android/AndroidManifest.xml to /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/target/AndroidManifest.xml
[INFO] Extracting libs
[INFO] Extracting apk app...
[INFO] Extracting aar api...
[INFO] Extracting aar play-services...
[INFO] Getting manifests of dependent apklibs
[INFO] Merging manifests of dependent apklibs
[INFO] Done Merging Manifests of APKLIBs
[INFO] Generating R file for org.eoti.bugs.mavenandroidplugin.issue358:test:apk:1.0-SNAPSHOT
[INFO] Generating R file for aar : org.eoti.bugs.mavenandroidplugin.issue358.api
[INFO] Generating R file for aar : com.google.android.gms
[INFO] Adding R gen folder to compile classpath: /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/target/generated-sources/r
[INFO] Skip BuildConfig.java generation for org.eoti.bugs.mavenandroidplugin.issue358 api
[INFO] Skip BuildConfig.java generation for org.eoti.bugs.mavenandroidplugin.issue358 api
[INFO] Adding AIDL gen folder to compile classpath: /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/target/generated-sources/aidl
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/src/main/resources
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ test ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 6 source files to /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/target/classes
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:proguard (default-proguard) @ test ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ test ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ test ---
[INFO] No tests to run.
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:emma (default-emma) @ test ---
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:dex (default-dex) @ test ---
[INFO] Convert classes to Dex : /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/target/classes.dex
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ test ---
[INFO] Building jar: /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/target/test-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:apk (default-apk) @ test ---
[INFO] Generating debug apk.
[INFO] Warning: AndroidManifest.xml already defines debuggable (in http://schemas.android.com/apk/res/android); using existing value in manifest.
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:internal-pre-integration-test (default-internal-pre-integration-test) @ test ---
[INFO] /usr/local/android-sdk-linux/build-tools/19.0.3/aapt [dump, xmltree, /home/malachi/work/public/bugs/maven-android-plugin/issue358/app/target/app-1.0-SNAPSHOT.apk, AndroidManifest.xml]
[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 R32D303E8KF_samsung_Nexus10 found.
[INFO] R32D303E8KF_samsung_Nexus10 :   Successfully uninstalled org.eoti.bugs.mavenandroidplugin.issue358.app
[INFO] /usr/local/android-sdk-linux/build-tools/19.0.3/aapt [dump, xmltree, /home/malachi/work/public/bugs/maven-android-plugin/issue358/app/target/app-1.0-SNAPSHOT.apk, AndroidManifest.xml]
[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 R32D303E8KF_samsung_Nexus10 found.
[INFO] R32D303E8KF_samsung_Nexus10 :   Successfully uninstalled org.eoti.bugs.mavenandroidplugin.issue358.app
[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 R32D303E8KF_samsung_Nexus10 found.
[INFO] R32D303E8KF_samsung_Nexus10 :   Successfully installed /home/malachi/work/public/bugs/maven-android-plugin/issue358/app/target/app-1.0-SNAPSHOT.apk
[INFO] /usr/local/android-sdk-linux/build-tools/19.0.3/aapt [dump, xmltree, /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/target/test-1.0-SNAPSHOT.apk, AndroidManifest.xml]
[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 R32D303E8KF_samsung_Nexus10 found.
[INFO] R32D303E8KF_samsung_Nexus10 :   Successfully uninstalled org.eoti.bugs.mavenandroidplugin.issue358.test
[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 R32D303E8KF_samsung_Nexus10 found.
[INFO] R32D303E8KF_samsung_Nexus10 :   Successfully installed /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/target/test-1.0-SNAPSHOT.apk
[INFO] 
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:internal-integration-test (default-internal-integration-test) @ test ---
[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 R32D303E8KF_samsung_Nexus10 found.
[INFO] R32D303E8KF_samsung_Nexus10 :   Running instrumentation tests in org.eoti.bugs.mavenandroidplugin.issue358.test
[INFO] R32D303E8KF_samsung_Nexus10 :     Run started: org.eoti.bugs.mavenandroidplugin.issue358.test, 1 tests:
[INFO] R32D303E8KF_samsung_Nexus10 :       Start [1/1]: org.eoti.bugs.mavenandroidplugin.issue358.test.BasicLaunch#testStart
[INFO] R32D303E8KF_samsung_Nexus10 :       ERROR:org.eoti.bugs.mavenandroidplugin.issue358.test.BasicLaunch#testStart
[INFO] R32D303E8KF_samsung_Nexus10 :       Test failed to run to completion. Reason: 'Instrumentation run failed due to 'java.lang.IllegalAccessError''. Check device logcat for details
[INFO] R32D303E8KF_samsung_Nexus10 :       End [1/1]: org.eoti.bugs.mavenandroidplugin.issue358.test.BasicLaunch#testStart
[INFO] R32D303E8KF_samsung_Nexus10 :     Run failed: Instrumentation run failed due to 'java.lang.IllegalAccessError'
[INFO] R32D303E8KF_samsung_Nexus10 :     Run ended: 0 ms
[ERROR] R32D303E8KF_samsung_Nexus10 :     FAILURES!!!
[INFO]   Tests run: 1,  Failures: 0,  Errors: 1
[INFO] R32D303E8KF_samsung_Nexus10 :   Report file written to /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/target/surefire-reports/TEST-R32D303E8KF_samsung_Nexus10.xml
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] issue358 .......................................... SUCCESS [  0.710 s]
[INFO] api ............................................... SUCCESS [ 17.478 s]
[INFO] app ............................................... SUCCESS [ 21.383 s]
[INFO] test .............................................. FAILURE [ 24.674 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:21 min
[INFO] Finished at: 2014-05-20T14:54:06-08:00
[INFO] Final Memory: 27M/485M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.9.0-SNAPSHOT:internal-integration-test (default-internal-integration-test) on project test: R32D303E8KF_samsung_Nexus10 :   Tests failed on device. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :test

I've seen instrumentation tests failing on 3 projects now. Benoit is also seeing failures. Maybe we can figure out what is different about your environment. Maybe your dependency tree is newer than ours?

from android-maven-plugin.

malachid avatar malachid commented on May 20, 2024

As I said, the other key piece to note is that mvn clean install -P JARPROVIDED 2>&1 | tee build.log works on 3.9.0-rc.1

from android-maven-plugin.

william-ferguson-au avatar william-ferguson-au commented on May 20, 2024

On Wed, May 21, 2014 at 7:55 AM, Malachi de AElfweald <
[email protected]> wrote:

From what I can tell:

  1. if the apk is specified as 'provided', it can't find the classes and
    the test/target/unpacked-libs/oebmi_api/ doesn't exist

Correct. This is expected behaviour.

  1. if the apk is not specified as 'provided', it does find the classes -
    twice - because that test/target/unpacked-libs/oebmi_api/classes.jar gets
    redexed

The classes are only available once to the test module. They are only DEXed
once. What I don't know/understand is how the instrumentation tests work.
If they start the test.apk and also load the app.apk in the same Android
process then that could be a problem.

But it is a problem that I am not seeing.

I've seen instrumentation tests failing on 3 projects now. Benoit is also

seeing failures. Maybe we can figure out what is different about your
environment. Maybe your dependency tree is newer than ours?

Yes, my maven-dep-tree instance is newer because Herve wanted to change the
interface. But the behaviour should be identical. NB
maven-dependecy-tree-2.2-SNAPSHOT should be available from apache-snapshots
now as it has been committed. But m,y pull request for AMP needs to be
merged to handle the change in interface.

My setup is:

Apache Maven: 3.2.1Java version: 1.7 (vendor: Oracle Corporation)
OS: Windows 8.1

Benoit, what's your environment look like?
And can you / can't you build Malachi's test project?

from android-maven-plugin.

william-ferguson-au avatar william-ferguson-au commented on May 20, 2024

Yes. But I would argue that it shouldn't have.
Unless the instrumentations are causing the test.apk to load up the app.apk

On Wed, May 21, 2014 at 7:59 AM, Malachi de AElfweald <
[email protected]> wrote:

As I said, the other key piece to note is that mvn clean install -P
JARPROVIDED 2>&1 | tee build.log works on 3.9.0-rc.1


Reply to this email directly or view it on GitHubhttps://github.com//issues/358#issuecomment-43689012
.

from android-maven-plugin.

malachid avatar malachid commented on May 20, 2024

The working version using 3.9.0-rc.1 if I use apktool to decompile the apk: 9 directories, 9 files
The non-working version using 3.9.0-SNAPSHOT: 159 directories, 2575 files

from android-maven-plugin.

malachid avatar malachid commented on May 20, 2024

Yes, the test.apk will launch the app.apk so duplicating the classes in it is a problem

from android-maven-plugin.

malachid avatar malachid commented on May 20, 2024

I'm currently using the 'resolving-reactor-deps' branch of the dependency tree.

from android-maven-plugin.

william-ferguson-au avatar william-ferguson-au commented on May 20, 2024

OK, so it's a very strange apk. It feels like it might even be a new build
type.

Sounds like we need to allow PROVIDED. This shouldn't be too hard. I
suspect it is a small change in the ClasspathLifeCycleParticipant.

On Wed, May 21, 2014 at 8:24 AM, Malachi de AElfweald <
[email protected]> wrote:

Yes, the test.apk will launch the app.apk so duplicating the classes in it
is a problem


Reply to this email directly or view it on GitHubhttps://github.com//issues/358#issuecomment-43691233
.

from android-maven-plugin.

malachid avatar malachid commented on May 20, 2024

So this is what I was thinking about last night... really there are a couple different possibilities:

  1. nothing in common (a'la Calabash)... in this case, the test has no dependencies on the app at all and it should be fine
  2. resources -- this is common when the only real overlap is in the manifest file. For example, the auto-generated test AndroidManifest.xml contains this line which comes from the aar dependency of the api:
    <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
    Maybe for this use case, duplicating the resources (without regenerating them) might be enough?
  3. api -- in this case, we'd be testing against enums/interfaces/etc in the API or the APP
    this is where I think the dex issue is coming in (but again, it works in 3.9.0-rc.1 currently)... maybe we compile against the unpacked_libs at system scope? not entirely sure... how is it currently working in the older version?

On the flip side, we have been doing the hacky thing of including the APK and the JAR for the test app... if we could just specify that the APK was provided, that would be really clean.

from android-maven-plugin.

william-ferguson-au avatar william-ferguson-au commented on May 20, 2024

I found the difference.
I am testing on a device running ART.
When I switch to Dalvik it fails in the same manner as you are seeing.

The solution is to get scope=provided to work for APK dependencies.

from android-maven-plugin.

william-ferguson-au avatar william-ferguson-au commented on May 20, 2024

Malachi, if you want to concentrate on this, I'll focus on #350 #361
To get scope=provide to work for APK deps you need to look at CompileMojo

from android-maven-plugin.

malachid avatar malachid commented on May 20, 2024

With 361 broke, should I roll back to a different pull request to work on this?

from android-maven-plugin.

william-ferguson-au avatar william-ferguson-au commented on May 20, 2024

Yep. Use #355

from android-maven-plugin.

malachid avatar malachid commented on May 20, 2024

I need to clean it up and test for side effects, but I might be onto something... this was with mvn clean install -P APKPROVIDED

[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:internal-integration-test (default-internal-integration-test) @ test ---
[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 R32D303E8KF_samsung_Nexus10 found.
[INFO] R32D303E8KF_samsung_Nexus10 :   Running instrumentation tests in org.eoti.bugs.mavenandroidplugin.issue358.test
[INFO] R32D303E8KF_samsung_Nexus10 :     Run started: org.eoti.bugs.mavenandroidplugin.issue358.test, 1 tests:
[INFO] R32D303E8KF_samsung_Nexus10 :       Start [1/1]: org.eoti.bugs.mavenandroidplugin.issue358.test.BasicLaunch#testStart
[INFO] R32D303E8KF_samsung_Nexus10 :       End [1/1]: org.eoti.bugs.mavenandroidplugin.issue358.test.BasicLaunch#testStart
[INFO] R32D303E8KF_samsung_Nexus10 :     Run ended: 898 ms
[INFO]   Tests run: 1,  Failures: 0,  Errors: 0
[INFO] R32D303E8KF_samsung_Nexus10 :   Report file written to /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/target/surefire-reports/TEST-R32D303E8KF_samsung_Nexus10.xml
[INFO] 
[INFO] --- maven-install-plugin:2.5.1:install (default-install) @ test ---
[INFO] Installing /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/target/test-1.0-SNAPSHOT.apk to /home/malachi/.m2/repository/org/eoti/bugs/mavenandroidplugin/issue358/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.apk
[INFO] Installing /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/pom.xml to /home/malachi/.m2/repository/org/eoti/bugs/mavenandroidplugin/issue358/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom
[INFO] Installing /home/malachi/work/public/bugs/maven-android-plugin/issue358/test/target/test-1.0-SNAPSHOT.jar to /home/malachi/.m2/repository/org/eoti/bugs/mavenandroidplugin/issue358/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] issue358 .......................................... SUCCESS [  0.655 s]
[INFO] api ............................................... SUCCESS [ 16.200 s]
[INFO] app ............................................... SUCCESS [ 19.946 s]
[INFO] test .............................................. SUCCESS [ 11.939 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:01 min
[INFO] Finished at: 2014-05-21T11:59:10-08:00
[INFO] Final Memory: 29M/487M
[INFO] ------------------------------------------------------------------------

from android-maven-plugin.

malachid avatar malachid commented on May 20, 2024

Running apktool on it:

.
├── test-1.0-SNAPSHOT
│   ├── AndroidManifest.xml
│   ├── apktool.yml
│   ├── original
│   │   ├── AndroidManifest.xml
│   │   └── META-INF
│   │       ├── CERT.RSA
│   │       ├── CERT.SF
│   │       └── MANIFEST.MF
│   └── smali
│       └── org
│           └── eoti
│               └── bugs
│                   └── mavenandroidplugin
│                       └── issue358
│                           └── test
│                               ├── AllTests.smali
│                               ├── BasicLaunch.smali
│                               └── BuildConfig.smali

from android-maven-plugin.

malachid avatar malachid commented on May 20, 2024

Some resource problems... updating the test case to capture them.

from android-maven-plugin.

malachid avatar malachid commented on May 20, 2024

I added a declare-styleable to the test as well, but it appears to be working.

from android-maven-plugin.

malachid avatar malachid commented on May 20, 2024

Seems to be working on my work project as well. Going to clean up and submit a pull request. I'll branch off of #355 to make sure that the branch is complete for testing.

from android-maven-plugin.

malachid avatar malachid commented on May 20, 2024

#362

from android-maven-plugin.

malachid avatar malachid commented on May 20, 2024

updated the test project to default to APKPROVIDED now. Once we confirm this and merge it in, we'll want to consider changing instructions for instrumentation tests.

from android-maven-plugin.

william-ferguson-au avatar william-ferguson-au commented on May 20, 2024

Well done!
On May 22, 2014 6:19 AM, "Malachi de AElfweald" [email protected]
wrote:

updated the test project to default to APKPROVIDED now. Once we confirm
this and merge it in, we'll want to consider changing instructions for
instrumentation tests.


Reply to this email directly or view it on GitHubhttps://github.com//issues/358#issuecomment-43808506
.

from android-maven-plugin.

william-ferguson-au avatar william-ferguson-au commented on May 20, 2024

This can be closed now that #362 has been merged.

from android-maven-plugin.

malachid avatar malachid commented on May 20, 2024

Agreed. Closing.

from android-maven-plugin.

mosabua avatar mosabua commented on May 20, 2024

Fix merged.

from android-maven-plugin.

Related Issues (20)

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.