I’m trying to use some Kotlin std-lib features (marked experimental, admittedly) from Kotlin 1.9 in my build scripts. I’m getting ‘Unresolved reference’ errors, and I’m wondering if there’s a possibility that my build scripts (I’m using the kotlin-dsl plugin version 2.1.20) are using an older kotlin language version?
The methods in question are the UByteArray.toHexString()
documented here: toHexString
I’m getting Unresolved reference: toHexString
from my code, which looks more or less like this:
@OptIn(kotlin.ExperimentalUnsignedTypes::class)
val bytes: UByteArray = Random.nextBytes(8).toUByteArray()
@OptIn(kotlin.ExperimentalUnsignedTypes::class , kotlin.ExperimentalStdlibApi::class)
val id: String = bytes.toHexString()
The UByteArray stuff is compiling fine, FWIW.
I have seen, but don’t entirely understand, the chart at Compatibility Matrix, but that doesn’t cover Gradle 8.13/8.14, and it’s not clear to me if it’s even relevant here.
Thanks for any pointers…