Repository: google/protobuf-gradle-plugin

Issue #444: Gradle Kotlin DSL changed method signature of NamedDomainObjectContainerExtensionsKt.invoke
Created: 2020-11-03T16:21:55Z
In KtDslCompatibilityUtils.java the plugin calls NamedDomainObjectContainerExtensionsKt.invoke(container, block) with block being a Function1<? super NamedDomainObjectContainerScope<T>, Unit>. In the latest Gradle build (6.8-milestone-2), that signature has been changed to Action<NamedDomainObjectContainerScope<T>>: gradle/gradle@593001e, so builds using the Kotlin DSL fail using new builds.

Duplicate issue #488: deprecated method is used in kotlin extension functions
Created: 2021-04-15T11:02:58Z
NamedDomainObjectContainer.invoke(kotlin.Function1)
Using method NamedDomainObjectContainer<T>.invoke(kotlin.Function1) has been deprecated. This is scheduled to be removed in Gradle 8.0. Recompile your plugin against Gradle >= 6.8 Consult the upgrading guide for further information: https://docs.gradle.org/6.8/userguide/upgrading_version_6.html#using_NamedDomainObjectContainer_invoke_kotlin_Function1
        at org.gradle.kotlin.dsl.NamedDomainObjectContainerExtensionsKt.invoke(NamedDomainObjectContainerExtensions.kt:61)
        at com.google.protobuf.gradle.KtDslCompatibilityUtils.configureNamedDomainObjectContainer(KtDslCompatibilityUtils.java:32)
        at com.google.protobuf.gradle.ProtobufConfiguratorExtsKt$plugins$1.invoke(ProtobufConfiguratorExts.kt:123)
        at com.google.protobuf.gradle.ProtobufConfiguratorExtsKt$plugins$1.invoke(ProtobufConfiguratorExts.kt)
        at org.gradle.kotlin.dsl.KotlinClosure1.doCall(GroovyInteroperability.kt:97)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
        at groovy.lang.Closure.call(Closure.java:405)
        at groovy.lang.Closure.call(Closure.java:421)
        at org.gradle.util.ClosureBackedAction.execute(ClosureBackedAction.java:71)
        at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:148)
        at org.gradle.util.ConfigureUtil.configureSelf(ConfigureUtil.java:142)
        at org.gradle.api.internal.AbstractNamedDomainObjectContainer.configure(AbstractNamedDomainObjectContainer.java:91)
        at org.gradle.api.internal.AbstractNamedDomainObjectContainer.configure(AbstractNamedDomainObjectContainer.java:38)
        at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:103)
        at org.gradle.util.ConfigureUtil$configure.call(Unknown Source)
        at com.google.protobuf.gradle.ProtobufConfigurator.plugins(ProtobufConfigurator.groovy:88)
        at com.google.protobuf.gradle.ProtobufConfiguratorExtsKt.plugins(ProtobufConfiguratorExts.kt:122)
        at Build_gradle$4.invoke(build.gradle.kts:36)

Closing comment (2021-04-16T10:00:13Z): Duplicate of #444. We are trying to add the extension function the new API.
Also, Gradle has reverted the API deletion at gradle/gradle#15508, and that change was included in Gradle 6.8 RC3. So if possible, upgrade your Gradle version to anything later than that.