pinchbv / android-analyzer

Android Gradle plugin for faster Sonarqube integration in Android projects. Supports Detekt and Jacoco out of the box.
http://pinch.nl
GNU General Public License v3.0
91 stars 16 forks source link

Android-analyser not working with gradle 4.0.0-alpha04 #25

Open KatieBarnett opened 4 years ago

KatieBarnett commented 4 years ago

I upgraded to the gradle version 4.0.0-alpha04 from 4.0.0-alpha03 today and android-analyser stopped my builds from working. When I commented out the plugin they worked again. I am using that version of gradle so I can use the latest canary Android Studio which requires this.

Using 1.4.1 version of android-analyser.

Errors received:

Unable to find method 'org.gradle.testing.jacoco.tasks.JacocoReport.setClassDirectories(Lorg/gradle/api/file/FileCollection;)V'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
A problem occurred configuring project ':app'.
> Could not create task ':app:androidAnalyzerJacoco'.
   > org.gradle.testing.jacoco.tasks.JacocoReport.setClassDirectories(Lorg/gradle/api/file/FileCollection;)V

I tried the recommended solutions multiple times to no avail.

AndroideRob-zz commented 4 years ago

@KatieBarnett thank you for finding this and opening an issue. This is top priority, I am going to investigate it asap. Should you find some more clues in the meantime, let me know. Thanks!

KatieBarnett commented 4 years ago

Any update on this @AndroideRob?

AndroideRob-zz commented 4 years ago

@KatieBarnett I have a possible fix in this branch: https://github.com/pinchbv/android-analyzer/tree/1.5.0-gradle-update

Will test it tomorrow on the Canary AS and let you know.

AndroideRob-zz commented 4 years ago

@KatieBarnett I fixed the plugin to work with Gradle 4.0.0-alpha05 and 6.1-milestone-3. Since these have not yet been released, I won't release 1.5.0 yet. Please use the branch for now.

Project-level build.gradle:

    repositories {
        maven {
            url "https://raw.github.com/pinchbv/android-analyzer/1.5.0-gradle-update/repo"
        }
    }
    dependencies {
        classpath "com.justpinch:androidanalyzer:1.5.0"
    }

gradle-wrapper.properties: distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-milestone-3-all.zip

Let me know if there is anything else I can do.

KatieBarnett commented 4 years ago

Thanks. Looks like it is working with your changes.

formatBCE commented 4 years ago

Case is, that version 1.5.0 works only with gradle 6.1-milestone-3, which requires Android Studio 4.0 (unstable). Please fix this - we need jacoco :)

snehabhegade commented 2 years ago

@AndroideRob-zz,

With Android Analyzer 1.5.0 I am getting the below error

Did anything change with this library? Thank you!