A couple of problems like you've described I did ...
# gradle
c
A couple of problems like you've described I did at some point solve like that. Although I've abandoned gradle kts in the end, because problem resolution process took too much time and I wanted to concentrate on kotlin itself and my business logic.