In my case, it was because of my kotlin version. Upgrading the kotlin version to 2.2.0 solved the problem.