Quality-Tools-for-Android 7.5 0.0 L5 Java This is an Android sample app + tests that will be used to work on various project to increase the quality of the Android platform.

Overview

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,
Comments
  • Running Sample App Hangs Eclipse IDE

    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.

    enhancement 
    opened by johnfrey99 8
  • Inconsistent code coverage formats

    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!

    opened by rp123 7
  • Jacoco profil not working

    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 ?

    opened by Deyine 2
  • Code Coverage Missing for Instrumentation Tests

    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.

    bug question 
    opened by rossimo 2
  • Removed duplicated maven.compiler.plugin declarations

    Removed duplicated maven.compiler.plugin declarations

    Maven 3 doesn't like duplicate declarations either in the same file or same pom hierarchy [1].

    [WARNING]
    [WARNING] Some problems were encountered while building the effective model for com.octo.android:android-sample-tests:apk:0.0.1-SNAPSHOT
    [WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-compiler-plugin @ line 113, column 12
    [WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:build-helper-maven-plugin is missing. @ line 95, column 12
    [WARNING]
    [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
    [WARNING]
    [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
    [WARNING]
    

    [1] http://doc.nuxeo.com/display/public/CORG/Maven+coding+rules

    opened by hborders 1
  • java.lang.NoClassDefFoundError: lombok/ast/AstVisitor

    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)
    
    opened by sjoe 1
  • EasyMock / java.lang.NoClassDefFoundError: com/google/dexmaker/stock/ProxyBuilder

    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

    opened by franck-serot 1
  • Could not transfer artifact com.google.android:uiautomator:pom:4.2.2 from/to octo:thirdparty

    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] 
    
    opened by krschultz 1
  • Missing extension android-maven-plugin:3.5.2

    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?

    duplicate 
    opened by Hirschen 1
  • 3.5.2-SNAPSHOT android-maven-plugin

    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]

    opened by imminent 1
  • classycle reports generation does not work

    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")
                )
            }
        }
    }
    
    opened by OleksandrKucherenko 0
  • Missing dependencies

    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

    opened by odehrani 1
  • UiAutomator + Gradle + Test Reports

    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!

    opened by glebPrischepa 1
  • Where is the Espresso Artifact for Maven?

    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: https://github.com/mosabua/maven-android-sdk-deployer/issues/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?

    opened by pkhivesara 0
  • Coverage on multi modules maven project

    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.

    opened by Michenux 0
Owner
Stéphane Nicolas
Open source enthusiast, Java & Linux fan, Android dev. Favorite topics: quality, performance, testability, dependency injection, continuous integration, gradle.
Stéphane Nicolas
Android app for testing out various networking capabilities

Networking Tools Collection of handy networking tools for everyday development. Port Scanning Subnet Device Finder (discovers devices on local network

Akshat Tiwari 3 Dec 4, 2021
This repo demonstrates how to work on CI/CD for Mobile Apps 📱 using Github Actions 💊 + Firebase Distribution 🎉

Android-CICD This repo demonstrates how to work on CI/CD for Mobile Apps ?? using Github Actions ?? + Firebase Distribution ?? Getting Started We are

Mohamed Elsharkawy 50 Nov 29, 2022
A sample Grocery Store app built using the Room, MVVM, Live Data, Rx Java, Dependency Injection (Kotlin Injection) and support Dark Mode

Apps Intro A sample Grocery Store app built using the Room, MVVM, Live Data, Rx Java, Dependency Injection (Kotlin Injection) and support Dark Mode In

Irsyad Abdillah 25 Dec 9, 2022
PlayPauseDrawable 1.9 0.0 L5 Java This is a sample Play & Pause Drawable with morphing animation for Android

#PlayPauseDrawable #Deprecated please go to https://github.com/tarek360/Material-Animation-Samples This is a sample Play & Pause Drawable with morphin

Ahmed Tarek 48 May 26, 2022
Sample Project for Android Support Library 23.2

SnapShot: Contains features Vector Drawable Animated Vector Drawable AppCompat DayNight theme Bottom Sheets Using BottomSheetDialog in day-night mode.

Huqiu Liao 779 Nov 24, 2022
This project is focused on the sample using the API's new preview version of Android-L, use of transitions, shadows etc...

Android L preview example Description This project is focused on the sample using the API's new preview version of Android-L, use of transitions, shad

Saul Molinero 165 Nov 10, 2022
This project is focused on the sample using the API's new preview version of Android-L, use of transitions, shadows etc...

Android L preview example Description This project is focused on the sample using the API's new preview version of Android-L, use of transitions, shad

Saul Molinero 165 Nov 10, 2022
Eutamin-C Sample Project

here-is-my-card About Eutamin-C Sample Project This is an android application using Euphony library "here-is-my-card" makes it easy to share business

Euphony 5 Sep 1, 2021
A sample project managing the dependencies using Gradle version catalog

playground-gradle-bom-dep-manage A sample project managing the dependencies using Gradle version catalog. Pros/Cons Comparison with dependency managem

Masatoshi Kubode 0 Nov 26, 2021
An example that demonstrates how to integrate a learning app with the EIDU platform

EIDU Sample Learning App This app is an example of how to create a learning app that integrates with the EIDU platform. Please consult dev.eidu.com fo

null 0 Dec 17, 2021
A sample app showing how to build an app using the MVI architecture pattern.

MVI Example This application was streamed live on Twitch to demonstrate how to build an application using MVI. You can find the VOD here for now: http

Adam McNeilly 46 Jan 2, 2023
A sample Android app which showcases advanced usage of Dagger among other open source libraries.

U+2020 A sample Android app which showcases advanced usage of Dagger among other open source libraries. Watch the corresponding talk or view the slide

Jake Wharton 5.7k Dec 22, 2022
How to apply meaningful and delightful motion in a sample Android app

Applying meaningful motion on Android How to apply meaningful and delightful motion in a sample Android app Read the complete post at https://medium.c

André Mion 167 Dec 19, 2022
Android sample app following best practices: Kotlin, Compose, Coroutines and Flow, Hilt, JetPack Navigation, ViewModel, MVVM and MVI, Retrofit, Coil

Foodies - Modern Android Architecture Foodies is a sample project that presents a modern 2021 approach to Android app development. The project tries t

null 362 Jan 2, 2023
A sample Android app that demonstrates how to use Firebase Authentication, Crashlytics, Cloud Firestore and Hilt with Jetpack Compose UI

showcase.mp4 Make it So This is a sample Android app that demonstrates how to use Firebase Authentication, Crashlytics, Cloud Firestore and Hilt with

null 107 Dec 31, 2022
Minimal example of how to safely share a file produced by a task in one project, with a task in another project.

How to share files across Gradle subprojects: A minimal example This is the Gradle project: . ├── producer │ └── build.gradle.kts ├── consumer │ └

Rob Moore 2 Dec 17, 2021
[] Port of Jake Wharton's U2020 sample app with use of MVP and Dagger 2

U+2020-mvp [DEPRECATED] We recomend to try Moxy framework instead of our solution. Port of Jake Wharton's U2020 sample app with use of MVP pattern and

Live Typing 315 Nov 14, 2022
📚 Sample Android Components Architecture on a modular word focused on the scalability, testability and maintainability written in Kotlin, following best practices using Jetpack.

Android Components Architecture in a Modular Word Android Components Architecture in a Modular Word is a sample project that presents modern, 2020 app

Madalin Valceleanu 2.3k Dec 30, 2022
Sample material transition animations for Android

See ListOfThings for a newer implementation. Android Material Transitions This Android project samples some Material Design-ish transitions for list i

Todd Way 1.2k Dec 7, 2022