Azure Devops Gradle@3 task stared failing

I’m using gradle@3 task in an azure devops yaml pipeline to bundle an android app.
The pipeline worked with no issues since December 2022.
24th May 2023 the pipeline failed with what I understand is a non specific error message, There have been no changes to the pipeline yaml file or app code since the last successful build.

The debug trace only provides details of java commands from the gradle build processes.

Has anyone else experienced this error and how did you fix it?

No signature of method: is applicable for argument types: (build_6t2iytcirzlbjcsfsvfejohl0$_run_closure1) values: [build_6t2iytcirzlbjcsfsvfejohl0$_run_closure1@f068a61]

Stack trace:

	at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(
	at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(
	at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(
	at org.gradle.util.Swapper.swap(
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(
	at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(
	at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(
	at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(
	at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$
	at org.gradle.launcher.daemon.server.DaemonStateCoordinator$
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(
	at org.gradle.internal.concurrent.ManagedExecutorImpl$
	at org.gradle.internal.concurrent.ThreadFactoryImpl$
Caused by: groovy.lang.MissingMethodException: No signature of method: is applicable for argument types: (build_6t2iytcirzlbjcsfsvfejohl0$_run_closure1) values: [build_6t2iytcirzlbjcsfsvfejohl0$_run_closure1@f068a61]
	at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$
	... 153 more

The error means, that something within your android { ... } block is not valid.
It would be very strange if this happened without any change in the build script or dependencies, unless you for example use a dynamic version for the Android Gradle plugin.
Unfortunately the error message with Groovy DSL are often not too helpful and you would need to either see the error or comment out random parts in the android { ... } block to find the actual problem.

This is one of the major points why I strongly recommend using the Kotlin DSL instead.
You immediately get type-safe build scripts, much more helpful error messages if you mess up the syntax and amazingly better IDE support when using a proper IDE like IntelliJ or Android Studio.

Hi Bjorn

I’ve attached the gradle file our build uses, we followed your advice and commented out each section of the android block of the gradle file until we found the point of the build failure.
The version code property on line 154 of the attached file has had a hard coded value of 1 since the pipeline was created and has never caused any issues until now.

We tried changing the versionCode to an incremental value 202306091 and got this error:

No signature of method: is applicable for argument types: (build_6t2iytcirzlbjcsfsvfejohl0$_run_closure1) values: [build_6t2iytcirzlbjcsfsvfejohl0$_run_closure1@68a891c8]

Here’s the section of the gradle file where the versionCode is parsed, is it possible that when the build consumes the version code a process runs which fails for a different reason?

versionCode 1
versionName “1.0”

defaultConfig {
applicationId bundleIdentifier
applicationIdSuffix “”
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion

println(“before assigining versionCode Application Version: ${applicationVersion}”)
versionCode 1

println(“after versionCode Application Version: ${applicationVersion}”)
versionName “1.0”
testBuildType System.getProperty(‘testBuildType’, ‘debug’) // This will later be used to control the test apk build type
testInstrumentationRunner ‘androidx.test.runner.AndroidJUnitRunner’
resValue “string”, “app_name”, appDisplayName
resValue “string”, “build_config_package”, bundleIdentifier
resValue “string”, “keystore_signature”, “/${signatureHash}”

Anchor Hanover Group Registered Office: Suites A & B, The Heal’s Building, 22-24 Torrington Place, London WC1E 7HJ. A charitable housing association registered as a society under the Co-operative and Community Benefit Societies Act 2014, No. 7843 and registered with the Regulator of Social Housing, No. LH4095. This email and any files transmitted with it are confidential. If you are not the intended recipient of this e-mail please contact the sender immediately, and permanently delete this e-mail. Do not use, disclose, copy, print or rely on the information contained in this e-mail or any attachment in any manner. The statements and opinions expressed in this message are those of the author and do not necessarily reflect those of Anchor Hanover Group. Anchor Hanover Group does not accept any responsibility for the author’s views. Reasonable care has been taken to ensure this communication does not contain computer viruses, but no responsibility is accepted, and recipients are advised to undertake their own checks.

(Attachment build (1).gradle is missing)

I’ve attached the gradle file our build uses

E-Mail attachments do not get attached to the forum.
But anyway at least I cannot tell you, I’m not into Android development, so cannot say much about AGP specifics.

is it possible that when the build consumes the version code a process runs which fails for a different reason?

Unlikely, the error means that the syntax you use is wrong, e. g. by calling a method that does not exist or similar.
Maybe the documentation of the AGP can help you.

PS: It is Björn or Bjoern, but not Bjorn. :wink: