Sebastian Lehrbaum
11/01/2023, 6:51 PMw: The Default Kotlin Hierarchy Template was not applied to 'project ':frontendshared'':
because I added some custom source sets.
So I added applyDefaultHierarchyTemplate()
and now I get Unresolved reference: applyDefaultHierarchyTemplate
even though Intellij thinks it should exist.
Here is the full project. A simple Gradle sync in Intellij/Android Studio or a clean will give the error. (The Kotlin Version is in Version.kt in BuildSrc, there is no other version defined)
I also tried a more extensive approach, with upgrading Gradle and using the new easy accessors for the source sets and changing the desktop source set to jvm, but that didn't help either. Since it increases the amount of error messages, I pushed it to a separate branch.
Thank you for your help!
EDIT: Issue found The issue is a Plugin com.codingfeline.buildkonfig
, when removed the build works fine. I don't know why, but I assume the plugin does something strange.Jeff Lockhart
11/01/2023, 7:05 PMby creating
) and dependsOn
declarations that the default hierarchy does for you.jvmMain
source set name, but the default template uses this source set name for the JVM source set, which you are naming desktopMain
. You should avoid reusing default source set names and instead name the additional source sets something else unique.Sebastian Lehrbaum
11/01/2023, 8:15 PMjvm("desktop")
, I can get behind the idea to make it standard for error resolution.
I don't think I was creating any of the default declarations, they are all by getting
statements. I'm only creating the custom source sets. If I missed something please clarify.
To make it more clear, I replaced them with the new accessors that should come with 1.9.20. Intellij can resolve the accessors, but the gradle build cannot, this has increased the amount of errors significantly sadly.
I have pushed this to a separate branch. The original "minimal" branch was intended to keep the changes from the working state minimal: https://github.com/findusl/initiative-tracker/tree/upgrade_kotlin_1_9_20com.codingfeline.buildkonfig
that causes the errorJeff Lockhart
11/01/2023, 9:26 PM