Finja Hauschild
05/13/2025, 8:44 AMuses(
name = "SetupGradle",
action = ActionsSetupGradle()
)
I have no issues.
However, calling it like this:
uses(
name = "Run Gradle Checks",
action = ActionsSetupGradle(
arguments = ":test:testClasses ktlintCheck " +
"--stacktrace " +
"-Ptarget=Android " +
"-Pplatform=Local " +
"-PdeviceType=Virtual " +
"-Padjust.token=$ADJUST_TOKEN"
)
)
Results in me getting an error stating that I'm trying to use a private constructor. However, this only happened suddenly. I've had this exact same call in my workflow file for a longer time now and since about two weeks it throws this error but only in PRs. When I'm trying to create the yaml file from this locally it works.
Unfortunately, the repository is company internal đ
otherwise I would share the whole code or repository link with you.
The dependencies I use in the file are as follows:
@file:Repository("<https://repo.maven.apache.org/maven2/>")
@file:Repository("<https://bindings.krzeminski.it>")
@file:DependsOn("io.github.typesafegithub:github-workflows-kt:3.4.0")
@file:DependsOn("actions:checkout:v4")
@file:DependsOn("actions:setup-java:v4")
@file:DependsOn("gradle:actions__setup-gradle:v4")
@file:DependsOn("gradle:actions__wrapper-validation:v4")
Piotr KrzemiĆski
05/13/2025, 8:50 AM@file:DependsOn
).
However, I noticed that the arguments
input was typed as a simple string in v3 (ref), and in v4 (ref) it became a list. Perhaps you have some outdated binding locally. Try purging the Maven cache entry for this action (look in ~/.m2
) and you should be able to reproduce & fix this issue locallyFinja Hauschild
05/13/2025, 8:52 AMPiotr KrzemiĆski
05/13/2025, 8:56 AMPiotr KrzemiĆski
05/13/2025, 9:00 AMFinja Hauschild
05/13/2025, 9:01 AMFinja Hauschild
05/13/2025, 9:02 AMuses(
name = "Run Gradle Checks",
action = ActionsSetupGradle(
arguments = listOf(
":test:testClasses ktlintCheck",
"--stacktrace",
"-Ptarget=Android",
"-Pplatform=Local",
"-PdeviceType=Virtual",
"-Padjust.token=$ADJUST_TOKEN"
)
)
)
This should be correct, right? However I still get that weird "constructor is private" issue... Did I do anything wrong here?Piotr KrzemiĆski
05/13/2025, 9:03 AM~/.m2
dir - your local Maven cache probably still remembers the binding with action
being a simple stringPiotr KrzemiĆski
05/13/2025, 9:03 AMPiotr KrzemiĆski
05/13/2025, 9:04 AMPiotr KrzemiĆski
05/13/2025, 9:22 AM./gradlew
. See the deprecation notice here.
So I'd convert the above code to something like:
uses(name = "Set up Gradle", action = ActionsSetupGradle())
run(name = "Run Gradle Checks", command = "./gradlew :test:testClasses ktlintCheck ...")
Vampire
05/13/2025, 9:30 AMPiotr KrzemiĆski
05/13/2025, 9:32 AMVampire
05/13/2025, 9:45 AMprivate
, then I get "Argument type mismatch" or "No parameter with name ... found".
But if the constructor is private, it complains that it cannot be accessed instead of complaining about parameter name or argument type regarding the accessible constructor. đVampire
05/13/2025, 9:46 AMFinja Hauschild
05/13/2025, 12:16 PMFinja Hauschild
05/13/2025, 12:17 PM./gradlew
call, thank you! I changed that somewhere else in the project but not there lolPiotr KrzemiĆski
05/13/2025, 12:22 PMrm -rf ~/.m2/repository/gradle/actions__setup-gradle/
Piotr KrzemiĆski
05/13/2025, 12:22 PMFinja Hauschild
05/13/2025, 12:27 PM./gradlew
call now and it worked đ
The command you just sent me worked as well btw, so thank you for that as well :)Finja Hauschild
05/13/2025, 12:27 PMVampire
05/14/2025, 1:26 PMPiotr KrzemiĆski
05/14/2025, 1:29 PMVampire
05/14/2025, 1:35 PMVampire
05/14/2025, 1:35 PMPiotr KrzemiĆski
05/14/2025, 1:37 PMPiotr KrzemiĆski
05/14/2025, 1:38 PMPiotr KrzemiĆski
06/23/2025, 4:37 AM