Search code examples
kotlingradlegradle-kotlin-dsl

Expression 'application' cannot be invoked as a function


I have a Kotlin application with kotlin-dsl gradle files. I'd like to set mainClassName to be able to use com.github.johnrengelman.shadow.

I'd like use the application for this and I gradle cannot resolve it even if I have application plugin applied.

Kotlin version: 1.6.10

enter image description here

After a lot of research it looks like I'm the only one who doesn't have application in the gradle file.


Solution

  • you need to add application to your plugins list like

    plugins {
        ...
        application
    }