<@U223RM5CH> does it sound similar to <https://kot...
# gradle
m
d
Huh. My issue seemed to have fixed itself after I updated gradle to
4.1
(That is, from
3.3
)
o
I would rather assume someone fixed it between 3.3 and 4.1 😄
😂 2
n
Ended up with one issue appearing after updating from Gradle 4.0 to 4.1. If the build file contains a buildscript block then the compile function cannot be called in a top level dependencies block, which is very weird!
Fixed the issue by replacing the buildscript block with the plugins block.
j
Are you using the
java-library
plugin? If so then that's probably your problem.
If you are using the
java-library
plugin you need some code like this for kotlin to work correctly.
Copy code
configurations {
	"apiElements" {
		/*
		 * Needed to configure kotlin to work correctly with the "java-library" plugin.
		 * See:
		 * <https://docs.gradle.org/current/userguide/java_library_plugin.html#sec:java_library_known_issues>
		 * <https://youtrack.jetbrains.com/issue/KT-18497>
		 */
		val compileKotlin: KotlinCompile by tasks
		outgoing
			.variants
			.getByName("classes")
			.artifact(mapOf(
				"file" to compileKotlin.destinationDir,
				"type" to "java-classes-directory",
				"builtBy" to compileKotlin
			))
	}
}
n
Not using the java-library plugin.
m
that is probably my problem