Gradle error with lack of mainClassName property in gradle build

The application plugin needs to know the main class for when it bundles the application.

In your case, you apply the application plugin for each subproject without specifying the main class for each of those subprojects.

I had the same problem and fixed it by specifying “mainClassName” at the same level as apply plugin: 'application' :

apply plugin: 'application'
mainClassName="com.something.MyMainClass"

If you want to specify it in the gradle.properties file you might have to write it as : projectName.mainClassName = ..

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)