https://kotlinlang.org logo
Title
r

Robert

04/11/2019, 9:10 PM
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

Dominaezzz

04/11/2019, 9:15 PM
Did you get this error in your common module?
r

Robert

04/11/2019, 9:24 PM
Yes
Should I use kotlinx-serialization-runtime-common instead?
d

Dominaezzz

04/11/2019, 9:30 PM
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

Dominaezzz

04/11/2019, 9:44 PM
Have you synced gradle? 🤷🏼
r

Robert

04/11/2019, 9:46 PM
Yes
d

Dominaezzz

04/11/2019, 9:47 PM
Are there any red lines in the Gradle window on the right? It'll highlight possible dependency issues.
r

Robert

04/11/2019, 9:48 PM
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

Dominaezzz

04/11/2019, 9:55 PM
Oh? So the IDE is happy but it doesn't build?
r

Robert

04/11/2019, 9:56 PM
Yeah
d

Dominaezzz

04/11/2019, 9:56 PM
Which platform are you building for? Sounds like native.
Do you have gradle metadata enabled?
r

Robert

04/11/2019, 9:58 PM
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:
if (requested.id.id == "kotlinx-serialization") {
                useModule("org.jetbrains.kotlin:kotlin-serialization:${requested.version}")
            }
edit; i removed this now
d

Dominaezzz

04/11/2019, 9:59 PM
Depends on the output from the build. The task name should give a hint.
r

Robert

04/11/2019, 10:00 PM
I do not have this in my settings.gradle.kts
enableFeaturePreview("GRADLE_METADATA")
d

Dominaezzz

04/11/2019, 10:00 PM
Do you have
enableFeaturePreview('GRADLE_METADATA')
in your
settings.gradle.kts
?
Add it lol
r

Robert

04/11/2019, 10:13 PM
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