Kotlin, gradle, idea - unresolved reference while using javaClass

The javaClass function is an old way to access the Java class of an object which only existed in Kotlin versions before 1.0. You need to use TestService::class instead. See the documentation for more information.