In my MPP I got this error `Unresolved reference: ...
# announcements
r
In my MPP I got this error
Unresolved reference: ByteBuffer
on the line where I do
import kotlinx.io.ByteBuffer
. In my
build.gradle.kts
I have this line
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.9.0")
, which also shows under the
Extenal dependencies
in my IDE. What could I do wrong?
d
Did you get this error in your common module?
r
Yes
Should I use kotlinx-serialization-runtime-common instead?
d
Hard to say. Can you put your
build.gradle.kts
in a gist?
It kinda is a mess, but i tried so many things on so many stuff 😉
d
Have you synced gradle? 🤷🏼
r
Yes
d
Are there any red lines in the Gradle window on the right? It'll highlight possible dependency issues.
r
No, none 😞
Ill try running a build again
Still the same error 😞
I can CTRL-click the ByteBuffer import from source just fine, brings me to the class def and all....
d
Oh? So the IDE is happy but it doesn't build?
r
Yeah
d
Which platform are you building for? Sounds like native.
Do you have gradle metadata enabled?
r
I don't know, how do I check? I have all my code in de
common
module/platform
I found this in my
settings.gradle.kts
btw, not sure if it is right or wrong or irrelevant:
Copy code
if (requested.id.id == "kotlinx-serialization") {
                useModule("org.jetbrains.kotlin:kotlin-serialization:${requested.version}")
            }
edit; i removed this now
d
Depends on the output from the build. The task name should give a hint.
r
I do not have this in my settings.gradle.kts
enableFeaturePreview("GRADLE_METADATA")
d
Do you have
enableFeaturePreview('GRADLE_METADATA')
in your
settings.gradle.kts
?
Add it lol
r
Still the same error 😞
Wow. It is possibly resolved, but I have to verify it tomorrow and check what I actually changed, time to sleep now. Thank you very much
It works now, but can't find one particular cause. Possibly it was a combination of enabling the metadata, and move the dependency around