KotlinDslScriptsParameter(correlationId=782785944245786, scriptFiles=[]) with Android Studio 4.0

Viewed 1165

With Android Studio 4.0 I'm seeing the following line printed in the build output when syncing the project with Gradle files:

KotlinDslScriptsParameter(correlationId=782841456084562, scriptFiles=[]) => StandardKotlinDslScriptsModel(scripts=[], commonModel=CommonKotlinDslScriptModel(classPath=[], sourcePath=[], implicitImports=[]), dehydratedScriptModels={}) - took 0.0 secs

I'm assuming this is some kind of debug leftover in the Android Gradle plugin. Is there any way to suppress it?

3 Answers

Just update Gradle to 6.2

In gradle-wrapper.properties

distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip

It turns out this was a minor bug in Gradle <6.2, not directly related to Android Studio or the Android Gradle plugin: A println call caused excessive logging, and was fixed in https://github.com/gradle/gradle/issues/11730

With the PR merged, the debug output can no longer be seen by default. So the solution is to update Gradle Wrapper to 6.2 or later (which will most likely be included by default with an upcoming version of the Android Gradle plugin).

To test and recreate the previous behavior with Gradle 6.2+, set the org.gradle.kotlin.dsl.logging system property to true, e.g. in gradle.properties:

systemProp.org.gradle.kotlin.dsl.logging.tapi=true
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip

Paste this code in your gradle-wrapper.properties of your app module

Related