I can't use `kotlin.random.Random` ... what's up w...
# announcements
b
I can't use
kotlin.random.Random
... what's up with that?
o
“Can’t use” is a little bit unspecific. What exactly is happening?
b
I'm trying to use it like this:
Copy code
import android.graphics.Color
import kotlin.random.Random

private val randomInt = { Random.nextInt(256) }

internal fun getRandomColor(): Int {
    val r = randomInt()
    val g = randomInt()
    val b = randomInt()

    return Color.rgb(r, g, b)
}
but Gradle gives an error:
Unresolved reference random
and
Unresolved reference Random
.
o
Do you have proper stdlib version in dependencies? Check in the Gradle window.
b
It was set to '1.2.71' 😅, setting it to '1.3.0' worked
Now I've got some other issues to dig in to