inside a Kotlin target block does not support constraints. That’s something the Kotlin plugin adds (not part of Gradle core).
But the mechanism is only an alternative to Gradle’s core dependency declaration mechanism.
You can use that instead to define dependencies and constraints.
Basically: