https://kotlinlang.org logo
#getting-started
Title
# getting-started
v

Vaios Tsitsonis

06/22/2022, 8:45 AM
Hello! I have a question but I was not sure which was the appropriate channel to post it. I have a multi-module project and I noticed that in some modules I can not use the
buildList
,
buildMap
, etc. due to
Unresolved reference
. In my gradle file I have added a stdlib dependency. So why does this happen? Does it need some extra configuration?
j

Joffrey

06/22/2022, 9:40 AM
Are you somehow using an old version of Kotlin in those modules? Did you apply the Kotlin plugin? You shouldn't have to apply the stdlib dependency yourself, the plugin takes care of it
v

Vaios Tsitsonis

06/22/2022, 10:16 AM
My gradle file looks like that
Copy code
plugins {
    kotlin("jvm")
}

dependencies {
    implementation("org.jetbrains.kotlin:kotlin-stdlib:1.6.21")
}
j

Joffrey

06/22/2022, 10:28 AM
A couple questions: 1. Where is the version for the Kotlin JVM plugin defined? Which one is it? 2. Where are you getting the unresolved reference errors? In your main code or in your gradle build scripts?
v

Vaios Tsitsonis

06/22/2022, 10:44 AM
1. Version is defined in the
gradle.properties
file. It is equals to '1.6.21' 2. I get the unresolved reference errors in my main code
j

Joffrey

06/22/2022, 10:49 AM
It might be a silly question, but did you import those funtions in your main code?
Do you only have the error in the IDE? Or also when running Gradle from the command line?
v

Vaios Tsitsonis

06/22/2022, 11:17 AM
Strange... But this seems to happen only in the IDE
l

Landry Norris

06/22/2022, 3:03 PM
Android Studio or IntelliJ? I’ve noticed Android Studio’s current version sometimes has issues with multi-module KMP projects.
v

Vaios Tsitsonis

06/22/2022, 3:06 PM
Android studio 2021.2.1 Patch 1. It is a native android project