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

Issue with Gradle 6.x #33

Open rahulsainani opened 4 years ago

rahulsainani commented 4 years ago

Recently we upgraded the gradle version and now the project sync doesn't work when the plugin is applied. This is the error, reproduced on 2 different projects using gradle 6.1.1 and 6.2

ERROR: 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.

Tried both the suggestions but this error is constant.

rahulsainani commented 4 years ago

It looks like sonarqube is the culprit with usages of some gradle internal apis. https://github.com/SonarSource/sonar-scanner-gradle/blob/master/src/main/java/org/sonarqube/gradle/AndroidUtils.java#L32

https://github.com/SonarSource/sonar-scanner-gradle/blob/master/src/main/java/org/sonarqube/gradle/SonarQubeTask.java#L30

rahulsainani commented 4 years ago

Update: Was able to successfully integrate sonarqube and jacoco plugin but not android analyzer on gradle 6+. It is actually an issue with this plugin it seems.

stephannielsen commented 4 years ago

Looks like the same issue as here: https://github.com/pinchbv/android-analyzer/issues/25

analyzer is not working yet with Gradle 6.x.

@AndroideRob You mentioned that gradle 6 is not yet released on #25 . By now, 6.3 is released as stable. Would you mind releasing a new version of this tool that supports Gradle 6.x?