Project fails to compile after renaming

I've faced the same issue. After the investigation i've found that issue is related to the build tools/compileSdk version combination.

What i had

android {
    compileSdkVersion 28
    buildToolsVersion "29.0.2"

...

What i changed

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"

UPD: I think that could be the more correct solution


Delete .gradle folder and rebuild project works for me.

It is not related to compileSdkVersion. your package name changed and so some file which cached in Android project have the old package name. For update that files, you should delete both the build folder and the .gradle folder and build the project again.