android-analyzer icon indicating copy to clipboard operation
android-analyzer copied to clipboard

Issue with Gradle 6.x

Open rahulsainani opened this issue 5 years ago • 3 comments

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 avatar Feb 24 '20 14:02 rahulsainani

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 avatar Feb 24 '20 15:02 rahulsainani

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.

rahulsainani avatar Mar 04 '20 17:03 rahulsainani

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?

stephannielsen avatar Mar 30 '20 07:03 stephannielsen