If your Kotlin version is > 2.0.0 then you are supposed to use the compose Gradle plugin.
You can find the guide that on official documentation here: https://developer.android.com/develop/ui/compose/compiler
The steps helped me solve the issue!