To solve this problem you need to either upgrade or downgrade your kotlin plugin
Solution 1: update the plugin
First go to Tools> Select Kotlin> Configure Kotlin Plugin Updates> select one of the kotlin plugins and click download (stable or early access, I chose early access to solve this problem).
And finally change the kotlin version in build.gradle (Project :) according to the downloaded version

Solution 2: downgrade plugin
If you are using a mac , then press: Command + , to open the preference, then select the plugin and find kotlin and uninstall it, it will revert to the previous version: 1.1.51
On a Windows machine, press Control + Alt + S to open the settings dialog, then select the plugins and find kotlin and delete it, it will revert to the previous version: 1.1.51

Note: Do not uncheck kotlin in plugins, otherwise it will disable kotlin and will not be able to recognize the kotlin file and syntax
source share