How to fix Module was compiled with an incompatible version of Kotlin error in Android

Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.1.16

To fix above error in Android Studio rebuild the project from the menu using Build -> Rebuild Project.