Got this error after updating my Kotlin plugin on android studio.
package com.inovate.kotlin.module3.decorations
fun main(args: Array<String>) {
makeDecorations()
}
fun makeDecorations() {
val d1 = Decorations("rectangle", 56, 20)
}
data class Decorations(val shape : String, val weight : Int, val area : Int)
This is the error:
* Where:
Initialization script '/private/var/folders/bn/st769wd16nv1d5_wccw8_tm00000gn/T/DecorationsKt_main__2.gradle' line: 27
* What went wrong:
A problem occurred configuring project ': app'.
> Could not create task ':app:DecorationsKt.main()'.
> SourceSet with name 'main' not found.
When I run a stack trace:
Caused by: org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreationException: Could not create task ':app:DecorationsKt.main()'.
Caused by: org.gradle.api.UnknownDomainObjectException: SourceSet with name 'main' not found.
I have updated all my dependencies, invalidated caches and restarted, and tried to delete my .idea folder but no luck.