Skip to content

When are we supporting gradle distribution gradle-6.1.1 #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
elye opened this issue Jun 19, 2020 · 12 comments
Open

When are we supporting gradle distribution gradle-6.1.1 #83

elye opened this issue Jun 19, 2020 · 12 comments

Comments

@elye
Copy link

elye commented Jun 19, 2020

Currently gradle sync will fail stating Cannot set the value of read-only property 'executionData' for task ':app:jacocoTestInternalDebugUnitTestReport' of type org.gradle.testing.jacoco.tasks.JacocoReport. when upgrade to gradle-6.1.1

@michpohl
Copy link

I didn't see it documented anywhere, but a bunch of blog posts and stackoverflow answers pointed me at replacing executionData = fileTree(...) with executionData.from fileTree(...) or alternatively .setFrom (...). I haven't dug deeper yet, but both replacement variants work for me with Gradle plugin 6.1.1 and above

@elevenetc
Copy link

The same issue. AndroidStudio is ready for 6.1.1 for already some time.

@userdimi
Copy link

userdimi commented Jul 2, 2020

Yes, please update to gradle 6.1.1

@theonlyjakobob
Copy link

Gradle upgrade says clearly what changed for Jacoco: https://docs.gradle.org/current/userguide/upgrading_version_5.html#other_deprecated_behaviors_and_apis

@alexis-morillo
Copy link

Apparently, on the class JacocoAndroidPlugin, line 73, this
reportTask.executionData.setFrom(project.files(executionData))
should be replaced by
reportTask.getExecutionData().setFrom(project.files(executionData))

@lion4ik
Copy link

lion4ik commented Jul 17, 2020

Hi guys, you can use 0.1.5-SNAPSHOT. It works fine because fixed in snapshot version. @arturdm could you please release it as stable in order to fix the problem for latest gradle?

@uziasferreirazup
Copy link

@lion4ik I don't find this version :/

@mohamed-khalifa
Copy link

mohamed-khalifa commented Jul 18, 2020

You can use https://plugins.gradle.org/plugin/com.hiya.jacoco-android as a temp solution till jacoco-android-gradle-plugin support 6.1.1. It is a fork fixes the issue by @autonomousapps.
These are the required changes
ryoyakawai/uitest_sample_android@0982e46

@alexis-morillo
Copy link

Would it be possible to have a released version ?

@autonomousapps
Copy link
Contributor

I have made my fork open source (apologies for somehow missing this earlier). Obviously this repo is no longer maintained. https://github.com/hiyainc-oss/android-jacoco

@lion4ik
Copy link

lion4ik commented Jul 28, 2020

@lion4ik I don't find this version :/

try this way:

buildscript {
  repositories {
  
    maven { url 'https://oss.jfrog.org/artifactory/oss-snapshot-local' }
  }
  dependencies {
  
    classpath 'com.dicedmelon.gradle:jacoco-android:0.1.5-SNAPSHOT'
  }
}

It worked for me.

@ivanTrogrlic
Copy link

ivanTrogrlic commented Aug 27, 2020

Since Artur is not updating this plugin, I decided to go with another solution following this tutorial -> https://www.rallyhealth.com/coding/code-coverage-for-android-testing
(took me like 20 minutes)

Basically, what you need to do is remove this plugin and use Jacoco plugin directly, and then just add task jacocoUnitTestReport to your app's gradle file (You'll find it in the tutorial above).

Anyway just follow the tutorial, but notice - it's a bit outdated, so you will have to remove this line from that jacocoUnitTestReport task
$buildDir = // Location of the build directory for the build Variant
and also, use classDirectories.from = ..., additionalSourceDirs.from =... etc. instead of classDirectories = ... since it's deprecated.

ndrnour added a commit to ndrnour/Catroid that referenced this issue Jun 7, 2021
… binding.

* remove kotlin android extensions plugin.
* upgrade kotlin_version to 1.4.21.
* upgrade gradle to 4.0.2.
* upgrade jacoco-android to 0.1.5-SNAPSHOT to have it work with the new gradle version, for more info see arturdm/jacoco-android-gradle-plugin#83
* remove android.enableUnitTestBinaryResources=true from gradle.properties cause it's deprecated.
* support view binding.
* adapt MainMenuFragment with view binding
ndrnour added a commit to ndrnour/Catroid that referenced this issue Jun 7, 2021
… binding.

* remove kotlin android extensions plugin.
* upgrade kotlin_version to 1.4.21.
* upgrade gradle to 4.0.2.
* upgrade jacoco-android to 0.1.5-SNAPSHOT to have it work with the new gradle version, for more info see arturdm/jacoco-android-gradle-plugin#83
* remove android.enableUnitTestBinaryResources=true from gradle.properties cause it's deprecated.
* support view binding.
* adapt MainMenuFragment with view binding

** extra:
* fix new lint warnings due to gradle upgrade
ndrnour added a commit to ndrnour/Catroid that referenced this issue Jun 14, 2021
… binding.

* remove kotlin android extensions plugin.
* upgrade kotlin_version to 1.4.21.
* upgrade gradle to 4.0.2.
* upgrade jacoco-android to 0.1.5-SNAPSHOT to have it work with the new gradle version, for more info see arturdm/jacoco-android-gradle-plugin#83
* remove android.enableUnitTestBinaryResources=true from gradle.properties cause it's deprecated.
* support view binding.
* adapt MainMenuFragment with view binding

** extra:
* fix new lint warnings due to gradle upgrade
Veve8010 pushed a commit to Veve8010/Catroid that referenced this issue Jun 22, 2021
… binding.

* remove kotlin android extensions plugin.
* upgrade kotlin_version to 1.4.21.
* upgrade gradle to 4.0.2.
* upgrade jacoco-android to 0.1.5-SNAPSHOT to have it work with the new gradle version, for more info see arturdm/jacoco-android-gradle-plugin#83
* remove android.enableUnitTestBinaryResources=true from gradle.properties cause it's deprecated.
* support view binding.
* adapt MainMenuFragment with view binding

** extra:
* fix new lint warnings due to gradle upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests