It's also the intended solution, the Kotlin manual...
# getting-started
k
It's also the intended solution, the Kotlin manual litteraly says
For example, properties can be initialized through dependency injection, or in the setup method of a unit test. [...] To handle this case, you can mark the property with the lateinit modifier
https://kotlinlang.org/docs/reference/properties.html