You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.61'
id "com.google.protobuf" version "0.8.12"
id "com.github.marcoferrer.kroto-plus" version "0.6.1"
id "idea"
}
krotoPlus {
config {
main {}
}
}
Will throw an exception (I'm using Gradle 5.6). Specifically, running this:
$ ./gradlew
Will throw this:
...
Caused by: java.lang.NoClassDefFoundError: com/google/protobuf/MessageOrBuilder
at com.github.marcoferrer.krotoplus.gradle.compiler.CompilerConfigWrapper.<init>(CompilerConfigWrapper.kt:46)
at com.github.marcoferrer.krotoplus.gradle.KrotoPlusPluginExtension$config$1.create(KrotoPlusPluginExtension.kt:31)
at com.github.marcoferrer.krotoplus.gradle.KrotoPlusPluginExtension$config$1.create(KrotoPlusPluginExtension.kt:26)
at org.gradle.api.internal.FactoryNamedDomainObjectContainer.doCreate(FactoryNamedDomainObjectContainer.java:106)
...
What fixes it
Getting the buildscript dependency from maven central instead of the Gradle plugin portal will fix the problem:
buildscript { // <-- add this
repositories {
jcenter()
}
dependencies {
classpath "com.github.marcoferrer.krotoplus:kroto-plus-gradle-plugin:0.6.1"
}
}
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.61'
id "com.google.protobuf" version "0.8.12"
id "idea"
}
apply plugin: 'com.github.marcoferrer.kroto-plus'// <-- and this
krotoPlus {
config {
main {}
}
}
Why this is happening
The plugin has a runtime dependency to com.google.protobuf:protobuf-java:3.9.0, which is not available on the Gradle Plugin Portal.
I just discovered this repo. You've done an amazing job! I've heard that Google is working on an official Kotlin API, but honestly it's going to be hard for them to catch up to this project :)
The text was updated successfully, but these errors were encountered:
Thanks for submitting this!
Since we aren’t embedding the dependency in within the plugin this error is expected. One alternative to adding the maven repository within the build script block is using the pluginManagement in settings.gradle
This would let you continue to use the plugins block in your build.gradle. Since this Gradle plugin is experimental your feedback might be a sign that we should consider embedding the dependency in the future
How to reproduce
The following minimal
build.gradle
:Will throw an exception (I'm using Gradle 5.6). Specifically, running this:
Will throw this:
What fixes it
Getting the buildscript dependency from maven central instead of the Gradle plugin portal will fix the problem:
Why this is happening
The plugin has a runtime dependency to
com.google.protobuf:protobuf-java:3.9.0
, which is not available on the Gradle Plugin Portal.I just discovered this repo. You've done an amazing job! I've heard that Google is working on an official Kotlin API, but honestly it's going to be hard for them to catch up to this project :)
The text was updated successfully, but these errors were encountered: