Skip to content
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

Gradle plugin error with gradle 8.0 (including workaround) #827

Open
simonpoole opened this issue Aug 7, 2023 · 2 comments
Open

Gradle plugin error with gradle 8.0 (including workaround) #827

simonpoole opened this issue Aug 7, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@simonpoole
Copy link

simonpoole commented Aug 7, 2023

Describe the bug
With gradle 8.0 the task (marathon*AndroidTestGenerateMarathonfile) that generates the marathon file will fail.

Marathon version 0.8.4, AGP 8.1

To Reproduce
Upgrade to gradle 8.0

Expected behavior
I believe Gradle 8.0 isn't supported yet so no expectation that the plugin would work :-)

Logs and reports

> Task :marathonCurrentDebugAndroidTestGenerateMarathonfile FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':marathonCurrentDebugAndroidTestGenerateMarathonfile'.
> Cannot access input property 'sdk' of task ':marathonCurrentDebugAndroidTestGenerateMarathonfile'. Accessing unreadable inputs or outputs is not supported. Declare the task as untracked by using Task.doNotTrackState(). See https://docs.gradle.org/8.0/userguide/incremental_build.html#disable-state-tracking for more details.

Devices (please complete the following information):
Not relevant

Additional context

A workaround is to add

afterEvaluate{
   tasks.named('marathonCurrentDebugAndroidTestGenerateMarathonfile') { 
        doNotTrackState('Gradle 8 compatibility hack') 
    }
}

to the build script, replace the task name with the one from your configuration.

Note: outside of this issue, things seem to work just fine on both Linux and WIndows systems.

@simonpoole simonpoole added the bug Something isn't working label Aug 7, 2023
@Malinskiy
Copy link
Member

Thanks for raising this,

I'll work on a fix and add another test case for this here https://github.com/MarathonLabs/marathon/blob/develop/marathon-gradle-plugin/src/test/kotlin/com/malinskiy/marathon/gradle/task/CachingTest.kt#L16

No promises on when it's going to be released though, for now, anyone with this issue should use provided workaround.

Sidenote: I sincerely hope that a fix for this issue will not break existing v7 setups

@simonpoole
Copy link
Author

Because of googles minimum SKD/API requirements for the play store essentially all maintained Android apps are going to migrate to AGP 8.1 and as a consequence gradle 8, so v7 is likely going away in any case as a mainstream version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants