This problem occurs on some devices, I tried in Pixel 4 XL API 30, API 29 and real device no problem, but in Pixel 4 API 30 got this error:
PlatformException(exception, BAD_REQUEST, null, null)
try {
final GoogleSignIn googleSignIn = GoogleSignIn();
final GoogleSignInAccount? googleUser = await googleSignIn.signIn(); // Receive my Google Account details
if (googleUser == null) return;
final googleAuth = await googleUser.authentication; // <-- Catch error here
credential = GoogleAuthProvider.credential(
accessToken: googleAuth.accessToken,
idToken: googleAuth.idToken
);
} catch (e) {
print(e); // PlatformException(exception, BAD_REQUEST, null, null)
}
Why does it happen on some devices? Is there a way to solve this problem?