Giter Club home page Giter Club logo

quality-tools-for-android's Introduction

Quality Tools for Android

This is an Android sample app + tests that will be used to work on various project to increase the quality of the Android platform.

The idea is that Android programming is still in its infancy compared to the Java world. The Android community needs more robustness in Android apps and it looks like a good idea to build on the Java world experience and use its best tools for Quality Analysis.

We want to provide a full featured industrial development environment that can be used to create more robust projects on Android, by using any of the most interesting and popular technologies.

Here are some slides to present Quality Tools for Android.

Already integrated :

  • Standard Android testing framework and code coverage using emma, reported in Sonar. That also covers robotium, easy mock and mockito technologies.
  • Robolectric testing framework and code coverage using Cobertura, reported in Sonar. Now in same eclipse project / maven module as app under test thanks to this thread.
  • UI Automator testing through a new android maven plugin goal (to be released in android-maven-plugin-3.5.2) and result in sonar.
  • Espresso / Android test kit
  • Configuration works out of the box in eclipse
  • Lint integration via Maven.
  • PMD, findbugs, checkstyle integration via Maven, reported in Sonar.
  • lint android maven lint integration (pom checker)
  • Monkey testing is now automated and reported in Sonar.
  • Add classycle support, to enforce architectural constraints, through classycle maven plugin
  • Spoon from square, including screenshots during tests.
  • maven-android-sdk-deployer to deliver android jars (including uiautomator)
  • sonar android lint plugin
  • FEST Android.
  • Jacoco offline instrumentation for both robolectric and standard junit tests.
  • Testing technologies integrated :
    • Standard Android tests
      • easymock
      • mockito
      • mockwebserver
      • robotium
      • fest-android
    • robolectric tests
      • hamcrest
      • easymock
      • mockito
  • Screenshot lib works during UIAutomator tests.
  • BoundBox is used in some StandardAndroid tests and Robolectric tests.
  • support for Travis CI.
  • Build Status on Travis: Build Status on Travis:

What is missing (TODO/INTEGRATE) :

  1. get aggregated tests and code coverage for all testing technologies inside a nice Sonar dashboard for Android.
  2. add support for monkey runner through maven
  3. add calabash support.
  4. Add support for JUnit 4 on Android : http://stackoverflow.com/questions/9809180/why-is-junit-4-on-android-not-working

Usage

This section describes how to build & test the project using those different testing technologies.

Please note that this project is under active development. Some goals may require a snapshot version of the maven android plugin available on sonatype snapshot repo.

Install Android Latest SDK through Android SDK Manager

This can be done graphically, or via command line (for CI servers).

Install the Android SDK through maven-android-sdk-deployer

As it takes time to get android jars in maven central, including android UI automator jars in maven central, we recommend to use maven-android-sdk-deployer to obtain android artefacts. This step can also be executed on a CI server.

#install Android SDK 17 local files to local maven repo  
git clone [email protected]:mosabua/maven-android-sdk-deployer.git
cd maven-android-sdk-deployer/
mvn install -P 4.2
#Add V4 support library (to use FEST Android)
cd extras/compatibility-v4/
mvn install

Standard Android testing APIs and code coverage using emma

To build the sample project and run the sample app on a plugged rooted device / running emulator :

# in parent folder
mvn clean install -P emma
mvn sonar:sonar -P emma

you will get tests results in : target/surefire-reports/. you will get tests coverage in : target/emma/.

Here is the result in sonar :

You may need to restart adb as root to be able to pull the emma coverage file. In a terminal, type :

adb root

Robolectric and code coverage using cobertura

# in parent folder
mvn clean cobertura:cobertura -P cobertura
mvn sonar:sonar -P cobertura

Here is the result in sonar :

Unified code coverage for both Robolectric and standard Android Junit tests via Jacoco

Using offline instrumentation of Jacoco, it is possilbe to completly replace emma by jacoco for instrumentation. This allows to get both robolectric and standard tests code coverage inside the same project dashboard with sonar.

  • Robolectric are considered standard unit tests.
  • standard Android Junit tests are considered as standard integration tests. This makes sense as Robolectric tests mock an android platform and can be considered more "unit" tests thant standard android tests because the latter needs a real android platform and relies on networking, disk, locale, etc. It would be better to be able to give names to the test suites inside the widget, and even to add more test suites, for instance to add UI testing (black box testing) or monkey testing.
# in parent folder
mvn clean install -P jacoco
mvn sonar:sonar -P jacoco

Here is the result in sonar :

UI Automator

# in parent folder
mvn clean install -P uiautomator
mvn sonar:sonar -P uiautomator

Here is the result in sonar :

Espresso

To build the sample project and run the sample app on a plugged device / running emulator :

# in parent folder
mvn clean install -P espresso

Spoon from Squareup

# in parent folder
mvn clean install -P spoon

#then browse to android-sample-tests/target/spoon-output/index.html

Here is the result in a browser :

Monkey testing

Monkey is part of Android SDK and allows to harness Application UI and test their robustness. We contributed to a new maven android plugin goal to use monkey automatically and get reports in junit format.

The results can be displayed inside sonar and will appear as normal unit tests.

# in parent folder
mvn clean compile -P monkey
mvn sonar:sonar -P monkey

Here is the result in sonar :

Package cycles check via classycle

You will need a JDK 1.7 for this profile to work correctly.

# in parent folder
mvn clean compile -P cycle

Will check package cycles (also called package tangling in Sonar) and check the build if given cycles are detected. Classycle lets you define architectural constraints that can be checked automatically.

Depedency definition files are very simple to edit. Here is an example :

show allResults

###define packages / groups of packages of interest

## layers
[ui] = com.octo.android.sample.ui.*
[other] = com.octo.android.sample.* excluding [ui]

###check layers integrity
check [other] independentOf [ui]

Robolectric development in eclipse

RoboElectric tests are separated from the sample project, as all testing technologies.

To make this configuration work in eclipse, do the following :

//TODO update this

  • after each "maven update" of your project, remember to configure the build path of your project, go to the last tab and uncheck maven dependencies so that they are not included into the final apk.
  • in your eclipse junit configuration for your project, add both "bin/classes" to the classpath, and set the environment variable ANDROID_HOME to the android home folder on your computer.
  • add the android jars from your maven repository to your junit run configuration in eclipse.

TODO : POST a SNAPSHOT of the JUnit run config in eclipse

Now, simply execute your project as a JUnit project and all robolectric tests will get executed.

Using Gradle

All gradle-related file are stored in folder gradle.

With Gradle 1.8+ and android gradle plugin 0.6.+ :

build the app under tests

# in parent folder
gradle clean assemble

launch the app under tests

# in parent folder
gradle :android-sample:installDebug

play standard android tests (without emma coverage):

# in parent folder
gradle clean assembleDebug connectedInstrumentTest
#export to sonar
gradle :android-sample:sonarRunner

play espresso tests (without emma coverage):

# in parent folder
gradle clean assembleDebug :android-sample-espresso-tests:connectedInstrumentTest

play robolectric tests :

# in parent folder
gradle clean assembleDebug robolectric
#export to sonar
gradle :android-sample-robolectric-tests:sonarRunner

Findbugs + Checkstyle + PMD + classycle :

# in parent folder
gradle check

or independently :

# in parent folder
#you need to run assemble before most of those
#gradle assembleDebug
gradle checkstyle
gradle findbugs
gradle pmd
gradle classycle

Running lint :

# in parent folder
gradle :android-sample:lint

Aggregate reports :

# in parent folder
gradle buildDashboard

TODO run test coverage using emma (standard tests):

TODO run test coverage using cobertura (robolectric tests):

TODO run test coverage using jacoco (both tests):

TODO play uiautomator tests

TODO play monkey tests

TODO play monkey runner tests

TODO shoot more stuff to sonar

Thanks to

Quality Tools for Android in the news !!

License

Copyright (C) 2013 Stéphane Nicolas & Jérôme Van Der Linden

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,

quality-tools-for-android's People

Contributors

emmanueldemey avatar realdadfish avatar stephanenicolas 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quality-tools-for-android's Issues

Code coverage with jacoco offline instrumentation does not support apklibs

Hi Stèphane,

thanks for your excellent quality tools project!

I try to setup code coverage measurement with jacoco on my project and use your project configuration as a base.

However my project has dependencies to apklibs what your project currently does not have.
Without apklibs, code coverage generation with jacoco works fine, but once I have such a dependency, running tests or even the app fails with a java.lang.VerifyError.

Do you have any idea, what could be the cause?

You can reproduce this quite easily by adding a dependency to say android-switch-backport to your sample project's pom.xml:

<dependency>
  <groupId>org.jraf</groupId>
  <artifactId>android-switch-backport</artifactId>
  <version>1.0</version>
  <type>apklib</type>
</dependency>

Then add a switch view to your layout/main.xml:

<org.jraf.android.backport.switchwidget.Switch
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="switch"/>

When you now make a mvn clean install -Pjacoco, the tests fail with this java.lang.VerifyError:

[INFO] android.device parameter not set, using all attached devices
[INFO] Device 004a433a11d490af_LGE_Nexus4 found.
[INFO] 004a433a11d490af_LGE_Nexus4 : Running instrumentation tests in com.octo.android.sample.test
[INFO] 004a433a11d490af_LGE_Nexus4 : Run started: com.octo.android.sample.test, 4 tests:
[INFO] 004a433a11d490af_LGE_Nexus4 : Start [1/4]: com.octo.android.sample.test.HelloAndroidActivityRobotiumTest#testCompute
[INFO] 004a433a11d490af_LGE_Nexus4 : ERROR:com.octo.android.sample.test.HelloAndroidActivityRobotiumTest#testCompute
[INFO] 004a433a11d490af_LGE_Nexus4 : Test failed to run to completion. Reason: 'Instrumentation run failed due to 'java.lang.VerifyError''. Check device logcat for details
[INFO] 004a433a11d490af_LGE_Nexus4 : End [1/4]: com.octo.android.sample.test.HelloAndroidActivityRobotiumTest#testCompute

And the stacktrace from logcat:

06-05 14:08:47.068: ERROR/AndroidRuntime(28587): FATAL EXCEPTION: main
java.lang.VerifyError: org/jraf/android/backport/switchwidget/Switch
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:587)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
at android.app.Activity.setContentView(Activity.java:1881)
at com.octo.android.sample.ui.HelloAndroidActivity.onCreate(HelloAndroidActivity.java:48)
at android.app.Activity.performCreate(Activity.java:5104)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)

I'm not sure whether this maybe is a problem with jacoco or the maven-android-plugin. What do you think?

Regards
Frank

Maven build fails on Mac JDK 1.6

Everything builds fine when I use JDK 1.7 on my Mac. I suspect this is related to one of these JDK bugs:

http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7073508
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7073477

Failing output is below.

LT-A8-120617:Quality-Tools-for-Android heath.borders$ mvn -version
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 10:22:22-0500)
Maven home: /usr/local/Cellar/maven/3.1.1/libexec
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"
LT-A8-120617:Quality-Tools-for-Android heath.borders$
LT-A8-120617:Quality-Tools-for-Android heath.borders$ mvn clean install -P jacoco
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] android-sample-parent
[INFO] android-sample
[INFO] android-sample-tests
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building android-sample-parent 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ android-sample-parent ---
[INFO] Deleting /Users/heath.borders/workspace/Quality-Tools-for-Android/target
[INFO] 
[INFO] --- lint-maven-plugin:0.0.6:check (default) @ android-sample-parent ---
PROFILES: [Profile {id: default, source: pom}, Profile {id: emma, source: pom}, Profile {id: cobertura, source: pom}, Profile {id: uiautomator, source: pom}, Profile {id: espresso, source: pom}, Profile {id: spoon, source: pom}, Profile {id: jacoco, source: pom}, Profile {id: monkey, source: pom}, Profile {id: cycle, source: pom}, Profile {id: monkeyrunner, source: pom}]
[INFO] Writing summary report
[INFO] [LINT] Completed with no violations
[INFO] Writing xml report
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ android-sample-parent ---
[INFO] Installing /Users/heath.borders/workspace/Quality-Tools-for-Android/pom.xml to /Users/heath.borders/.m2/repository/com/octo/android/android-sample-parent/0.0.1-SNAPSHOT/android-sample-parent-0.0.1-SNAPSHOT.pom
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building android-sample 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ android-sample ---
[INFO] Deleting /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample/target
[INFO] 
[INFO] --- lint-maven-plugin:0.0.6:check (default) @ android-sample ---
PROFILES: [Profile {id: default, source: pom}, Profile {id: emma, source: pom}, Profile {id: cobertura, source: pom}, Profile {id: uiautomator, source: pom}, Profile {id: spoon, source: pom}, Profile {id: jacoco, source: pom}, Profile {id: monkey, source: pom}, Profile {id: cycle, source: pom}, Profile {id: monkeyrunner, source: pom}]
[INFO] Writing summary report
[INFO] [LINT] Completed with no violations
[INFO] Writing xml report
[INFO] 
[INFO] --- android-maven-plugin:3.8.2:generate-sources (default-generate-sources) @ android-sample ---
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] Manifest merging disabled. Using project manifest only
[INFO] /Users/heath.borders/android/adt-bundle-mac-x86_64/sdk/build-tools/19.1.0/aapt [package, -f, --no-crunch, -I, /Users/heath.borders/android/adt-bundle-mac-x86_64/sdk/platforms/android-17/android.jar, -M, /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample/AndroidManifest.xml, -S, /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample/res, -m, -J, /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample/target/generated-sources/r, --output-text-symbols, /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample/target, --auto-add-overlay]
[INFO] 
[INFO] --- maven-checkstyle-plugin:2.9.1:check (checkstyle-check) @ android-sample ---
[INFO] 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ android-sample ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample/src/main/resources
[INFO] skip non existing resourceDirectory /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample/target/generated-sources/extracted-dependencies/src/main/resources
[INFO] 
[INFO] --- android-maven-plugin:3.8.2:consume-aar (default-consume-aar) @ android-sample ---
[INFO] Extracting classes for all aar dependencies
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ android-sample ---
[INFO] Compiling 5 source files to /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample/target/classes
[INFO] 
[INFO] --- android-maven-plugin:3.8.2:proguard (default-proguard) @ android-sample ---
[INFO] 
[INFO] --- jacoco-maven-plugin:0.6.2.201302030002:instrument (instrument-classes) @ android-sample ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ android-sample ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ android-sample ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ android-sample ---
[INFO] No tests to run.
[INFO] 
[INFO] --- android-maven-plugin:3.8.2:emma (default-emma) @ android-sample ---
[INFO] 
[INFO] --- android-maven-plugin:3.8.2:dex (default-dex) @ android-sample ---
[INFO] /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java [-Xmx1024M, -jar, /Users/heath.borders/android/adt-bundle-mac-x86_64/sdk/build-tools/19.1.0/lib/dx.jar, --dex, --output=/Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample/target/classes.dex, /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample/target/classes, /Users/heath.borders/.m2/repository/org/jacoco/org.jacoco.agent/0.6.2.201302030002/org.jacoco.agent-0.6.2.201302030002-runtime.jar, /Users/heath.borders/.m2/repository/android/support/compatibility-v4/19/compatibility-v4-19.jar, /Users/heath.borders/.m2/repository/joda-time/joda-time/2.2/joda-time-2.2.jar]
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ android-sample ---
[INFO] Building jar: /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample/target/android-sample-0.0.1-SNAPSHOT.jar
[INFO] 
[INFO] --- android-maven-plugin:3.8.2:apk (default-apk) @ android-sample ---
[INFO] Enabling debug build for apk.
[INFO] /Users/heath.borders/android/adt-bundle-mac-x86_64/sdk/build-tools/19.1.0/aapt [package, -f, -M, /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample/AndroidManifest.xml, -S, /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample/res, --auto-add-overlay, -I, /Users/heath.borders/android/adt-bundle-mac-x86_64/sdk/platforms/android-17/android.jar, -F, /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample/target/android-sample-0.0.1-SNAPSHOT.ap_, --debug-mode]
[INFO] 
[INFO] --- jacoco-maven-plugin:0.6.2.201302030002:restore-instrumented-classes (restore-instrumented-classes) @ android-sample ---
[INFO] 
[INFO] --- android-maven-plugin:3.8.2:internal-pre-integration-test (default-internal-pre-integration-test) @ android-sample ---
[INFO] 
[INFO] --- android-maven-plugin:3.8.2:internal-integration-test (default-internal-integration-test) @ android-sample ---
[INFO] 
[INFO] >>> findbugs-maven-plugin:2.5.2:check (findbugs-check) @ android-sample >>>
[INFO] 
[INFO] --- findbugs-maven-plugin:2.5.2:findbugs (findbugs) @ android-sample ---
[INFO] Fork Value is true
     [java] The following classes needed for analysis were missing:
     [java]   java.rmi.Remote
     [java] Missing classes: 1
[INFO] Done FindBugs Analysis....
[INFO] 
[INFO] <<< findbugs-maven-plugin:2.5.2:check (findbugs-check) @ android-sample <<<
[INFO] 
[INFO] --- findbugs-maven-plugin:2.5.2:check (findbugs-check) @ android-sample ---
[INFO] BugInstance size is 0
[INFO] Error size is 0
[INFO] No errors/warnings found
[INFO] 
[INFO] >>> maven-pmd-plugin:2.7.1:check (pmd-check) @ android-sample >>>
[INFO] 
[INFO] --- maven-pmd-plugin:2.7.1:pmd (pmd) @ android-sample ---
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO] 
[INFO] <<< maven-pmd-plugin:2.7.1:check (pmd-check) @ android-sample <<<
[INFO] 
[INFO] --- maven-pmd-plugin:2.7.1:check (pmd-check) @ android-sample ---
[INFO] 
[INFO] 
[INFO] >>> maven-pmd-plugin:2.7.1:cpd-check (pmd-check) @ android-sample >>>
[INFO] 
[INFO] --- maven-pmd-plugin:2.7.1:cpd (cpd) @ android-sample ---
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO] 
[INFO] <<< maven-pmd-plugin:2.7.1:cpd-check (pmd-check) @ android-sample <<<
[INFO] 
[INFO] --- maven-pmd-plugin:2.7.1:cpd-check (pmd-check) @ android-sample ---
[INFO] 
[INFO] 
[INFO] --- maven-install-plugin:2.5.1:install (default-install) @ android-sample ---
[INFO] Installing /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample/target/android-sample-0.0.1-SNAPSHOT.apk to /Users/heath.borders/.m2/repository/com/octo/android/android-sample/0.0.1-SNAPSHOT/android-sample-0.0.1-SNAPSHOT.apk
[INFO] Installing /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample/pom.xml to /Users/heath.borders/.m2/repository/com/octo/android/android-sample/0.0.1-SNAPSHOT/android-sample-0.0.1-SNAPSHOT.pom
[INFO] Installing /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample/target/android-sample-0.0.1-SNAPSHOT.jar to /Users/heath.borders/.m2/repository/com/octo/android/android-sample/0.0.1-SNAPSHOT/android-sample-0.0.1-SNAPSHOT.jar
[INFO] 
[INFO] --- android-maven-plugin:3.8.2:lint (lint) @ android-sample ---
[INFO] Performing lint analysis.
[INFO] Writing Lint XML report in /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample/target/lint-results/lint-results.xml
[INFO] Running command: /Users/heath.borders/android/adt-bundle-mac-x86_64/sdk/tools/lint
[INFO] with parameters: [--showall, --xml, /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample/target/lint-results/lint-results.xml, --sources, /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample/src/main/java, /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample, --exitcode]
[INFO] Lint analysis completed successfully.
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building android-sample-tests 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ android-sample-tests ---
[INFO] Deleting /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample-tests/target
[INFO] 
[INFO] --- lint-maven-plugin:0.0.6:check (default) @ android-sample-tests ---
PROFILES: [Profile {id: emma, source: pom}, Profile {id: spoon, source: pom}, Profile {id: jacoco, source: pom}]
[INFO] Writing summary report
[INFO] [LINT] Completed with no violations
[INFO] Writing xml report
[INFO] 
[INFO] --- android-maven-plugin:3.8.2:generate-sources (default-generate-sources) @ android-sample-tests ---
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] Manifest merging disabled. Using project manifest only
[INFO] /Users/heath.borders/android/adt-bundle-mac-x86_64/sdk/build-tools/19.1.0/aapt [package, -f, --no-crunch, -I, /Users/heath.borders/android/adt-bundle-mac-x86_64/sdk/platforms/android-17/android.jar, -M, /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample-tests/AndroidManifest.xml, -S, /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample-tests/res, -A, /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample-tests/target/generated-sources/combined-assets/assets, -m, -J, /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample-tests/target/generated-sources/r, --output-text-symbols, /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample-tests/target, --auto-add-overlay]
[INFO] 
[INFO] --- build-helper-maven-plugin:1.8:add-source (add-source) @ android-sample-tests ---
[INFO] Source directory: /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample-tests/target/generated-sources/annotations added.
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ android-sample-tests ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample-tests/src/main/resources
[INFO] skip non existing resourceDirectory /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample-tests/target/generated-sources/extracted-dependencies/src/main/resources
[INFO] 
[INFO] --- android-maven-plugin:3.8.2:consume-aar (default-consume-aar) @ android-sample-tests ---
[INFO] Extracting classes for all aar dependencies
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ android-sample-tests ---
[INFO] Compiling 8 source files to /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample-tests/target/classes
Jun 10, 2014 3:07:54 PM org.boundbox.processor.BoundBoxProcessor process
INFO: mirror org.boundbox.BoundBox
Jun 10, 2014 3:07:54 PM org.boundbox.processor.BoundClassScanner visitTypeAsClass
INFO: class ->HelloAndroidActivity
Jun 10, 2014 3:07:54 PM org.boundbox.processor.BoundClassScanner visitTypeAsClass
INFO: nested ->false
Jun 10, 2014 3:07:54 PM org.boundbox.processor.BoundClassScanner addTypeToImport
INFO: Adding to imports com.octo.android.sample.ui.HelloAndroidActivity
Jun 10, 2014 3:07:54 PM org.boundbox.processor.BoundClassScanner visitTypeAsClass
INFO: super class -> com.octo.android.sample.ui.HelloAndroidActivity-->android.support.v4.app.FragmentActivity
Jun 10, 2014 3:07:54 PM org.boundbox.processor.BoundClassScanner visitTypeAsClass
INFO: class ->ButtonClickListener
Jun 10, 2014 3:07:54 PM org.boundbox.processor.BoundClassScanner visitTypeAsClass
INFO: nested ->true
Jun 10, 2014 3:07:54 PM org.boundbox.processor.BoundClassScanner addTypeToImport
INFO: Adding to imports com.octo.android.sample.ui.HelloAndroidActivity.ButtonClickListener
Jun 10, 2014 3:07:54 PM org.boundbox.processor.BoundClassScanner visitTypeAsClass
INFO: super class -> com.octo.android.sample.ui.HelloAndroidActivity.ButtonClickListener-->java.lang.Object
Jun 10, 2014 3:07:54 PM org.boundbox.processor.BoundClassScanner visitExecutable
INFO: executable -><init>
Jun 10, 2014 3:07:54 PM org.boundbox.processor.BoundClassScanner visitExecutable
INFO: executable ->onClick
java.lang.NullPointerException
    at org.boundbox.model.FieldInfo.<init>(FieldInfo.java:34)
    at org.boundbox.model.MethodInfo.<init>(MethodInfo.java:61)
    at org.boundbox.processor.BoundClassScanner.visitExecutable(BoundClassScanner.java:156)
    at org.boundbox.processor.BoundClassScanner.visitExecutable(BoundClassScanner.java:31)
    at com.sun.tools.javac.code.Symbol$MethodSymbol.accept(Symbol.java:1230)
    at org.boundbox.processor.BoundClassScanner.visitTypeAsClass(BoundClassScanner.java:145)
    at org.boundbox.processor.BoundClassScanner.visitTypeAsClass(BoundClassScanner.java:31)
    at javax.lang.model.util.ElementKindVisitor6.visitType(ElementKindVisitor6.java:118)
    at com.sun.tools.javac.code.Symbol$ClassSymbol.accept(Symbol.java:835)
    at org.boundbox.processor.BoundClassScanner.visitTypeAsClass(BoundClassScanner.java:145)
    at org.boundbox.processor.BoundClassScanner.visitTypeAsClass(BoundClassScanner.java:31)
    at javax.lang.model.util.ElementKindVisitor6.visitType(ElementKindVisitor6.java:118)
    at com.sun.tools.javac.code.Symbol$ClassSymbol.accept(Symbol.java:835)
    at org.boundbox.processor.BoundClassScanner.scan(BoundClassScanner.java:49)
    at org.boundbox.processor.BoundBoxProcessor.process(BoundBoxProcessor.java:182)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:627)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:556)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:701)
    at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:987)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
    at com.sun.tools.javac.main.Main.compile(Main.java:353)
    at com.sun.tools.javac.main.Main.compile(Main.java:279)
    at com.sun.tools.javac.main.Main.compile(Main.java:270)
    at com.sun.tools.javac.Main.compile(Main.java:87)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess0(JavacCompiler.java:551)
    at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:526)
    at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:167)
    at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:678)
    at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
    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:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java: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)
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample-tests/src/main/java/com/octo/android/sample/test/HelloAndroidActivityBoundBoxTest.java:[9,33] cannot find symbol
symbol  : class BoundBoxOfHelloAndroidActivity
location: package com.octo.android.sample.ui
[ERROR] /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample-tests/src/main/java/com/octo/android/sample/test/HelloAndroidActivityBoundBoxTest.java:[15,12] cannot find symbol
symbol  : class BoundBoxOfHelloAndroidActivity
location: class com.octo.android.sample.test.HelloAndroidActivityBoundBoxTest
[INFO] 2 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] android-sample-parent ............................. SUCCESS [1.235s]
[INFO] android-sample .................................... SUCCESS [22.231s]
[INFO] android-sample-tests .............................. FAILURE [0.773s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25.225s
[INFO] Finished at: Tue Jun 10 15:07:54 CDT 2014
[INFO] Final Memory: 34M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project android-sample-tests: Compilation failure: Compilation failure:
[ERROR] /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample-tests/src/main/java/com/octo/android/sample/test/HelloAndroidActivityBoundBoxTest.java:[9,33] cannot find symbol
[ERROR] symbol  : class BoundBoxOfHelloAndroidActivity
[ERROR] location: package com.octo.android.sample.ui
[ERROR] /Users/heath.borders/workspace/Quality-Tools-for-Android/android-sample-tests/src/main/java/com/octo/android/sample/test/HelloAndroidActivityBoundBoxTest.java:[15,12] cannot find symbol
[ERROR] symbol  : class BoundBoxOfHelloAndroidActivity
[ERROR] location: class com.octo.android.sample.test.HelloAndroidActivityBoundBoxTest
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :android-sample-tests

Coverage on multi modules maven project

Hi,

My project has the following structure:
root

  • app (android)
  • common (standard java library)
  • tests

Emma works fine, but in the emma report, i can't see the classes of the
common module.

Jacoco profil not working

Hi Stephane
thanks for sharing this config, it was very useful for me.

However, jacoco profil not work for me, as sonar show only "Unit tests coverage" block with 0%.

image

Emma profil works fine

image

Sonar 3.7.3 .

Do you have any idea about this issue ?

Code Coverage Missing for Instrumentation Tests

I've tested using the EMMA, Cobertura, and Jacoco profiles, but I can't seem to get any code coverage results from the instrumentation tests. I deleted 'MyActivityTest.java' to keep the Robolectric tests from running to ensure only instrumentation tests are avaliable.

Should I be getting code coverage results from instrumentation tests? I'm running ADB with root access.

License

Can you add a license ( or maybe mark this as explicitly in the Public Domain )?

Thanks.

Missing dependencies

I'm trying to build the project, but there is a problem with the dependencies in pom.xml:

[WARNING] The POM for android:android:jar:4.2.2_r2 is missing, no dependency information available
[WARNING] The POM for android.test.uiautomator:uiautomator:jar:4.2.2_r2 is missing, no dependency information available

I saw in stackoverflow that there is a maven android sdk deployer but it's not clear how to fix it.

Thanks,
Rani

classycle reports generation does not work

I rewrite the classycle.gradle file, now it generates correctly reports:

attching:

apply from: '../config/classycle.gradle'

check.dependsOn 'checkstyle', 'findbugs', 'pmd', 'cpd', 'classycle'

and classycle.gradle itself:

configurations {
    codequality
}

dependencies {
    codequality files("$project.rootDir/config/quality/classycle/classycle-1.4.1.jar")
}

task classycle(type: AndroidClassycleTask) {
    copy {
        from "${project.rootDir}/config/quality/classycle/images"
        into "${project.buildDir}/reports/classycle/images"
    }
}

/* ================================================================================================================ */

/**
 * See parameters at http://classycle.sourceforge.net/apidoc/classycle/ant/ReportTask.html
 */
class AndroidClassycleTask extends DefaultTask {
    @org.gradle.api.tasks.InputFile
    @org.gradle.api.tasks.Optional
    File xslFile = new File("$project.rootDir/config/quality/classycle/reportXMLtoHTML.xsl")

    @org.gradle.api.tasks.OutputFile
    @org.gradle.api.tasks.Optional
    File outputFile = new File("$project.buildDir/reports/classycle/classycle-results.xml")

    FileCollection classycleClasspath = project.configurations.codequality
    Boolean html = false
    Project gradleProject = project

    def AndroidclassycleTask() {
        description = 'Runs classycle against Android source sets.'
        group = 'Code Quality'
    }

    @TaskAction
    def runClassycle() {
        outputFile.parentFile.mkdirs()

        def antBuilder = services.get(org.gradle.api.internal.project.IsolatedAntBuilder)
        antBuilder.withClasspath(classycleClasspath).execute {
            ant.taskdef(name: 'classycle', classname: 'classycle.ant.ReportTask')

            ant.classycle(reportFile: outputFile) {
                fileset(dir: "$gradleProject.buildDir/classes")
            }
        }

        if (html && xslFile != null && xslFile.exists()) {
            ant.xslt(in: outputFile,
                    style: xslFile,
                    out: outputFile.absolutePath.replaceFirst(~/\.[^\.]+$/, ".html")
            )
        }
    }
}

Can not execute SonarQube analys is: Unable to execute Sonar: Fail to parse the Surefire report

hi:
when I excute mvn sonar:sonar -P uiautomator
I got the error:[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.2:sonar (d
efault-cli) on project android-sample-ui-tests: Can not execute SonarQube analys
is: Unable to execute Sonar: Fail to parse the Surefire report: F:\program files
\eclipse\workspace\android-sample-parent\android-sample-ui-tests\target\surefire
-reports\TEST-HC31PW100344_HTC_HTCS720t16GB.xml: Invalid UTF-8 start byte 0xb6 (at char #11875, byte #11775)

is this a configuration problem or a bug? please help me figure out
thanks

Inconsistent code coverage formats

We have been able to get cobertura code coverage for robolectic, using the steps you mentioned.

For UI Automation, we are using MonkeyRunner. We have Emma code coverage setup for MonkeyRunner.

Now we would like to aggregate code coverage, but are running into format issue.

Questions:
Is it possible to get Emma code coverage for robolectic? Or
Is it possible to get Cobertura code coverage for MonkeyRunner?

Goal is to have the code coverage reports in the same format so we can merge it.

Thanks!

Task for PMD, Checkstyle, Findbugs

Hi Stephane,

Really thank you for this awesome work !

I was playing with it, and I did not really understood why we need to use task for launching PMD, Checkstyle, or Findbugs. Is this a limitation of the current android plugin for Gradle ? Obviously there is something wrong since if I want to configure for example the checkstyle source without using a task with something like that :

checkstyle {
configFile file("${project.rootDir}/config/quality/checkstyle/checkstyle.xml")
source 'src'
include 'some java files'
exclude 'the gen folder'
classpath = files()
}

Gradle will give me this result :
unsupported Gradle DSL method found :'source()'

Of course the solution of using a task works perfectly but I really would like to understand why we have to do this way :)

And again, thank for sharing this awesome work !

Missing extension android-maven-plugin:3.5.2

When doing mvn clean install:

Unresolveable build extension: Plugin com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.2-SNAPSHOT or one of its dependencies could not be resolved: Failure to find com.jayway.maven.plugins.android.generation2:android-maven-plugin:jar:3.5.2-SNAPSHOT in http://oss.sonatype.org/content/repositories/jayway-snapshots/

Seems like the snapshot is missing at the specific address. Anything Im doing wrong maybe?

Where is the Espresso Artifact for Maven?

Looking at the setup on the repo it is NOT AT ALL clear on how do we get espresso running via maven. The readme says install the latest maven-android-sdk-deployer and i am assuming that you should be good for running espresso using the artifact as specified in the sample pom as nothing else is mentioned after that. However, the issue on the maven-android-sdk-deployer repo: simpligility/maven-android-sdk-deployer#250 clearly states that it cannot be deployed via the deployer.
Can anyone point out how to get espresso running via maven? Is the readme on this repo not up-to-date or am i missing something?

java.lang.NoClassDefFoundError: lombok/ast/AstVisitor

Hi I have just pulled the project and wanted to build it with:

mvn clean install

Then I received the following error:

[INFO] --- android-maven-plugin:3.6.1:lint (lint) @ android-sample ---
[INFO] Performing lint analysis.
[INFO] Writing Lint XML report in D:\project\mobile\Quality-Tools-for-Android\android-sample\target\lint-results\lint-results.xml
[INFO] Running command: D:\apps\Android\android-sdk-r22_3\tools\lint.bat
[INFO] with parameters: [--showall, --xml, D:\project\mobile\Quality-Tools-for-Android\android-sample\target\lint-results\lint-results.xml, --sources, D:\project\mobile\Quality-Tools-for-Android\andro
id-sample\src\main\java, D:\project\mobile\Quality-Tools-for-Android\android-sample, --exitcode]
[INFO] Exception in thread "main" java.lang.NoClassDefFoundError: lombok/ast/AstVisitor
[INFO]  at com.android.tools.lint.checks.BuiltinIssueRegistry.<clinit>(BuiltinIssueRegistry.java:46)
[INFO]  at com.android.tools.lint.Main.run(Main.java:127)
[INFO]  at com.android.tools.lint.Main.main(Main.java:112)
[INFO] Caused by: java.lang.ClassNotFoundException: lombok.ast.AstVisitor
[INFO]  at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
[INFO]  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
[INFO]  at java.security.AccessController.doPrivileged(Native Method)
[INFO]  at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
[INFO]  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[INFO]  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
[INFO]  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

Code coverage for monkeyrunner using JaCoCo

I tried updating the profile for monkeyrunner as below. But the app crashes when the test runs and this happens only on instrumented build.

I am looking for some insight on this.

Thanks,
Jeff

Error:

W/dalvikvm( 6413): VFY: invoke type does not match method type of Lcom/abc/xyz/model/Article;._getPartsMap

Useful link:

https://groups.google.com/forum/#!topic/android-platform/KUwF6KJDb70

Useful comment from the link:

I figured it out!

Turns out that the methods which were not getting executed from the
constructor were private and final. However, the byte-compiler of
Rhino was emitting invoke-virtuals in the constructor for those
methods. dx faithfully converted them and retained their invoke-
virtual character. I changed them to invooke-direct with the effect
that the compilation now works! Thanks for all your help!

My experiment:

Changed _getPartsMap from private to public.
It stopped complaining about _getPartsMap and complained about the next. I change the next method to public and it went on to the once after that.

I don't think making these methods public is a solution, but I am hoping it might have some clues.

Rest of the error message: (Below is the error message I see after Dalvikvm error, mentioned above)

E/AndroidRuntime(14361): FATAL EXCEPTION: main
E/AndroidRuntime(14361): java.lang.RuntimeException: Unable to create application <app_package>.MainApplication: java.lang.IllegalStateException: Could not construct instance of helper class class <app_package>.persistence.ApplicationOpenHelper
...
...
Caused by: java.lang.IllegalArgumentException: Unknown class specified for dataClass: <app_package>.model.Article

pom.xml:

${jacoco-plugin.version} is set to 0.6.4-SNAPSHOT

<profile>
    <id>monkeyrunner</id>
    <dependencies>
        <dependency>
            <groupId>org.jacoco</groupId>
            <artifactId>org.jacoco.agent</artifactId>
            <version>${jacoco-plugin.version}</version>
            <classifier>runtime</classifier>
            <scope>compile</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco-plugin.version}</version>
                <executions>
                    <execution>
                        <id>instrument-classes</id>
                        <goals>
                            <goal>instrument</goal>
                        </goals>
                        <configuration>
                            <excludes>
                                <exclude>*test*</exclude>
                                <exclude>*/test/*</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>restore-instrumented-classes</id>
                        <phase>package</phase>
                        <goals>
                            <goal>restore-instrumented-classes</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                <artifactId>android-maven-plugin</artifactId>
                <configuration>
                    <monkeyrunner>
                        <skip>false</skip>
                        <injectDeviceSerialNumberIntoScript>true</injectDeviceSerialNumberIntoScript>
                        <createReport>true</createReport>
                        <programs>
                            <program>
                                <filename>src/test/monkeyrunner/testFile.py</filename>
                            </program>
                            <!-- Monkey Tests go here <program> <filename>src/test/monkeyrunner/example-test.py</filename> 
                                </program> <program> <filename>src/test/monkeyrunner/example-test2.py</filename> 
                                </program> -->
                        </programs>
                    </monkeyrunner>
                </configuration>
                <executions>
                    <execution>
                        <id>install-app</id>
                        <phase>install</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>run-monkey-runner</id>
                        <phase>install</phase>
                        <goals>
                            <goal>monkeyrunner</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</profile>

Gradle support?

Hi,
Since the new Android Studio has been presented at Google IO 2013 and Android itself is moving to Gradle built system, do you have plans for Gradle support?

Could not transfer artifact com.google.android:uiautomator:pom:4.2.2 from/to octo:thirdparty

Maven 3.0.4
android-maven-plugin 3.5.2-SNAPSHOT
mvn clean install -X

[ERROR] Failed to execute goal on project android-sample-ui-tests: Could not resolve dependencies for project com.octo.android:android-sample-ui-tests:jar:0.0.1-SNAPSHOT: Failed to collect dependencies for [com.google.android:android:jar:4.1.1.4 (provided), com.google.android:uiautomator:jar:4.2.2 (provided), junit:junit:jar:3.8.2 (provided)]: Failed to read artifact descriptor for com.google.android:uiautomator:jar:4.2.2: Could not transfer artifact com.google.android:uiautomator:pom:4.2.2 from/to octo.thirdparty (https://projets.octo.com/nexus/content/repositories/thirdparty/): Not authorized, ReasonPhrase:Unauthorized. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project android-sample-ui-tests: Could not resolve dependencies for project com.octo.android:android-sample-ui-tests:jar:0.0.1-SNAPSHOT: Failed to collect dependencies for [com.google.android:android:jar:4.1.1.4 (provided), com.google.android:uiautomator:jar:4.2.2 (provided), junit:junit:jar:3.8.2 (provided)]
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:210)
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:117)
    at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:258)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:201)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: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: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.project.DependencyResolutionException: Could not resolve dependencies for project com.octo.android:android-sample-ui-tests:jar:0.0.1-SNAPSHOT: Failed to collect dependencies for [com.google.android:android:jar:4.1.1.4 (provided), com.google.android:uiautomator:jar:4.2.2 (provided), junit:junit:jar:3.8.2 (provided)]
    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:158)
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:185)
    ... 22 more
Caused by: org.sonatype.aether.collection.DependencyCollectionException: Failed to collect dependencies for [com.google.android:android:jar:4.1.1.4 (provided), com.google.android:uiautomator:jar:4.2.2 (provided), junit:junit:jar:3.8.2 (provided)]
    at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:258)
    at org.sonatype.aether.impl.internal.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:308)
    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:150)
    ... 23 more
Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for com.google.android:uiautomator:jar:4.2.2
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:296)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)
    at org.sonatype.aether.impl.internal.DefaultDependencyCollector.process(DefaultDependencyCollector.java:412)
    at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:240)
    ... 25 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not transfer artifact com.google.android:uiautomator:pom:4.2.2 from/to octo.thirdparty (https://projets.octo.com/nexus/content/repositories/thirdparty/): Not authorized, ReasonPhrase:Unauthorized.
    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.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:281)
    ... 28 more
Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact com.google.android:uiautomator:pom:4.2.2 from/to octo.thirdparty (https://projets.octo.com/nexus/content/repositories/thirdparty/): Not authorized, ReasonPhrase:Unauthorized.
    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:951)
    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:939)
    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:669)
    at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)
    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:722)
Caused by: org.apache.maven.wagon.authorization.AuthorizationException: Not authorized, ReasonPhrase:Unauthorized.
    at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:839)
    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.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:601)
    ... 4 more
[ERROR] 

PMD check doesn't seem to work (for gradle)

Steps to reproduce:

  1. execute command 'gradle pmd'

Expected behaviour:
PMD report is generated and present in /report directory

Actual result:
no PMD result is present. Task ends with 'UP-TO-DATE' status:

:android-sample:pmd UP-TO-DATE

Running Sample App Hangs Eclipse IDE

After importing the project into eclipse via "Import Existing Maven Projects" the sample app hangs eclipse when trying to run it with "Run as Android Application". The output in the console reports "Dx warning: Ignoring InnerClasses attribute for an anonymous inner class" and eventually Eclipse runs out of memory.

I'm not sure if this is an issue with your project per se so much as an issue with the maven eclipse plugin leaving test scoped dependencies in the android classpath at runtime. I remember seeing this issue before with maven projects using robolectric tests in the same project as the main app.

Would it be possible to separate out the robolectric tests into a separate maven module and still get unit test coverage reported via cobertura or jacoco? I did some experimenting with this but failed to get the coverage to work.

Findbugs classpath configuration

For me the findbugs configuration specifically this line

classpath = files( project.configurations.compile.asPath )

is causing issues, I'm trying with android gradle plugin v0.8+ and gradle v1.10

EasyMock / java.lang.NoClassDefFoundError: com/google/dexmaker/stock/ProxyBuilder

Hi,
I studied the sample android-sample-robolectric-tests.
I tried to create an android-demo project with a simple HelloWorld Activity and a button in order to display the current date in a Toast when the button is clicked.
I could implemented some tests like your sample but I have a problem with EasyMock.
I used the same version of the testing librairies than your sample.

My problem is when I try to mock a class from my Android projet or a simple class like String.
For example :
HelperDate mockHelperDate = EasyMock.createMock(HelperDate.class);
The error is below.

I tried to add the librairy dexmaker v1.0 but I had an other error because no device is connected. If I understand dexmarker is required for test on device.
Could you please help to solve my problem ?
Best regards,
Franck

java.lang.NoClassDefFoundError: com/google/dexmaker/stock/ProxyBuilder
at org.easymock.internal.AndroidClassProxyFactory.createProxy(AndroidClassProxyFactory.java:40)
at org.easymock.internal.MocksControl.createMock(MocksControl.java:114)
at org.easymock.internal.MocksControl.createMock(MocksControl.java:88)
at org.easymock.internal.MocksControl.createMock(MocksControl.java:79)
at org.easymock.EasyMock.createMock(EasyMock.java:136)
at com.orange.demo.HelloAndroidActivityTest.shouldGetDateUsingEasyMock(HelloAndroidActivityTest.java:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:234)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:175)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.ClassNotFoundException: com.google.dexmaker.stock.ProxyBuilder
at org.robolectric.bytecode.AsmInstrumentingClassLoader.findClass(AsmInstrumentingClassLoader.java:119)
at org.robolectric.bytecode.AsmInstrumentingClassLoader.loadClass(AsmInstrumentingClassLoader.java:95)
... 31 more

Possible Error During Findbugs

When I run mvn clean install -P jacoco, I see the following in output:

[INFO] Fork Value is true
     [java] The following classes needed for analysis were missing:
     [java]   java.rmi.Remote
     [java] Missing classes: 1
[INFO] Done FindBugs Analysis....
[INFO] 

That seems bad. I don't know anything about findbugs, but I thought this should be noted.

System:

LT-A8-120617:Quality-Tools-for-Android heath.borders$ java -version
java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)
LT-A8-120617:Quality-Tools-for-Android heath.borders$ mvn -version
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 10:22:22-0500)
Maven home: /usr/local/Cellar/maven/3.1.1/libexec
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"

Cobertura : xerces error

I tried to run the "mvn clean cobertura:cobertura -P cobertura" on your test project.

It keeps failing with the following error.
I tried on both configurations :

  • Mac with Mountain Lion
    -- Java version "1.6.0_51"
    -- Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
  • CentOs
    -- java version "1.7.0_03"
    -- Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 14:51:28+0100)

Is this a known issue ?

java.lang.NoSuchFieldError: fFeatures
at org.apache.xerces.parsers.XML11Configuration.(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at org.apache.xerces.parsers.ObjectFactory.newInstance(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.findJarServiceProvider(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
at org.apache.xerces.parsers.DOMParser.(Unknown Source)
at org.apache.xerces.parsers.DOMParser.(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source)
at org.robolectric.AndroidManifest.parseAndroidManifest(AndroidManifest.java:118)
at org.robolectric.AndroidManifest.getTargetSdkVersion(AndroidManifest.java:259)
at org.robolectric.RobolectricTestRunner.pickSdkVersion(RobolectricTestRunner.java:293)
at org.robolectric.RobolectricTestRunner.getEnvironment(RobolectricTestRunner.java:267)
at org.robolectric.RobolectricTestRunner.access$100(RobolectricTestRunner.java:57)
at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:190)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:177)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

What's the operating system of these code test on?

hi,
I'm totally freshman to android auto-testing tools. In the past, I always work on eclipse under windows.
Well, what operating system does these code test on by your instruction? ubuntu , mac or windows? Pls tell me...
THX

add selendroid

http://selendroid.io/

allows one to use the Selenium WebDriver API to test native and web view based apps.

This is currently being used by eBay, Facebook and Salesforce.

(Btw this project is awesome! Thanks for it!)

UI Automator Stub Exception?

I think I'm doing something wrong but my ui-automator has this 'Stub' issue when running the test. I get:

Tests in error:
initializationError(com.twansoftware.invoicemakerpro.uitests.SimpleTest): Stub!

But then it looks like it starts trying to test:
[INFO] 047ba94d5c0aa8bb_LGE_Nexus4 : Running ui uiautomator tests ininvoicemakerpro-ui-tests-2.97.jar
[INFO] 047ba94d5c0aa8bb_LGE_Nexus4 : Run started: ui uiautomator tests, 0 tests:
[INFO] 047ba94d5c0aa8bb_LGE_Nexus4 : Run failed: Instrumentation run failed due to 'java.lang.RuntimeException'
[INFO] 047ba94d5c0aa8bb_LGE_Nexus4 : Run ended: 0 ms
[INFO] Tests run: 0, Failures: 0, Errors: 0
[INFO] 047ba94d5c0aa8bb_LGE_Nexus4 : Report file written to /home/achuinard/Code/InvoiceMakerPro/invoicemakerpro/ui-tests/target/surefire-reports/TEST-047ba94d5c0aa8bb_LGE_Nexus4.xml

But the RuntimeException is just the 'Stub!'.

Does this relate to the build.xml in the directory possibly?

3.5.2-SNAPSHOT android-maven-plugin

I don't see (and maven isn't resolving) 3.5.2-SNAPSHOT at https://oss.sonatype.org/content/repositories/jayway-snapshots/com/jayway/maven/plugins/android/generation2/android-maven-plugin/ is it in a different place? It seems that 3.5.2 is necessary for the UIAutomator.

[ERROR] The project com.octo.android:android-sample:0.0.1-SNAPSHOT (/Users/dandre/Android_Development/Quality-Tools-for-Android/android-sample/pom.xml) has 2 errors
[ERROR] Unresolveable build extension: Plugin com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.2-SNAPSHOT or one of its dependencies could not be resolved: Failure to find com.jayway.maven.plugins.android.generation2:android-maven-plugin:jar:3.5.2-SNAPSHOT in http://oss.sonatype.org/content/repositories/jayway-snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of oss.sonatype.org-jayway-snapshots has elapsed or updates are forced -> [Help 2]
[ERROR] Unknown packaging: apk @ line 13, column 13
[ERROR]
[ERROR] The project com.octo.android:android-sample-ui-tests:0.0.1-SNAPSHOT (/Users/dandre/Android_Development/Quality-Tools-for-Android/android-sample-ui-tests/pom.xml) has 1 error
[ERROR] Unresolveable build extension: Plugin com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.2-SNAPSHOT or one of its dependencies could not be resolved: Failure to find com.jayway.maven.plugins.android.generation2:android-maven-plugin:jar:3.5.2-SNAPSHOT in http://oss.sonatype.org/content/repositories/jayway-snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of oss.sonatype.org-jayway-snapshots has elapsed or updates are forced -> [Help 2]

UiAutomator + Gradle + Test Reports

Hi, everybody!

I am developing tests using UiAutomator but cannot get test reports.
I see that you somehow managed to create test report and display it using Sonar plugin.
I am curious...how to get test reports ?

Thanks, in advance!

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.