My app was running fine but suddenly I started getting this error
java.lang.NoSuchMethodError: No static method isAtLeastR()Z in class Landroidx/core/os/BuildCompat; or its super classes (declaration of 'androidx.core.os.BuildCompat' appears in /data/app/com.app.goflatmates-RZKwS2h6hav==/base.apk) at com.google.android.gms.common.util.PlatformVersion.isAtLeastR(com.google.android.gms:play-services-basement@@17.2.0:21) at com.google.android.gms.common.api.GoogleApi.zaa(com.google.android.gms:play-services-base@@17.2.0:128) at com.google.android.gms.common.api.GoogleApi.(com.google.android.gms:play-services-base@@17.2.0:23) at com.google.android.gms.common.api.GoogleApi.(com.google.android.gms:play-services-base@@17.2.0:54) at com.google.android.gms.auth.api.signin.GoogleSignInClient.(Unknown Source:3) at com.google.android.gms.auth.api.signin.GoogleSignIn.getClient(Unknown Source:3
The problem is coming in this line
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail()
.build();
mGoogleSignInClient = GoogleSignIn.getClient(this, gso);
The bug was in
com.google.android.gms:play-services-base:17.2.0
The previous answers saying to downgrade to 17.1.0 were correct, but Google has fixed the issue now, so you can upgrade to 17.2.1 and it also works fine.These three were updated together, so bump them all up if you're using them:
Source: https://developers.google.com/android/guides/releases
I fixed it by setting this in my app/build.gradle
Android Q is a finalised release and this method is no longer necessary. It will be removed in a future release of the Support Library.
Kindly downgrade version
I had this issue with React Native as well. I fixed it by setting this in my app/build.gradle:
It's because of a breaking change introduced by Google play-services-base library a couple days ago. If you use
implementation 'com.google.android.gms:play-services-base:+'
it will download the latest version of the library, introducing that bug into your app. Hope that helps.