I had the same problem and I resolved it with the following change in my code:
change this
android { compileSdkVersion 28 defaultConfig { targetSdkVersion 28 }}
To
android { compileSdkVersion 30 defaultConfig { targetSdkVersion 30 }}