[google_sign_in_android] v7 Credential Manager flow silently fails on Android 14 devices — HiddenActivity launches but account picker never renders
- Dominant language
- Dart
- Stars
- 179k
- Forks
- 31.1k
- PR merge metrics
- PR metrics pending
Description
## Description
On devices running Android 14, calling
`GoogleSignIn.instance.authenticate()` (the `google_sign_in` v7 API)
never shows the account picker. A transparent `HiddenActivity` from
`androidx.credentials.playservices.controllers.identityauth` is
launched and stays alive, which causes the status bar to go dark, but
no bottom sheet or dialog appears. Pressing the system back button
dismisses the `HiddenActivity`
The user never saw any UI — they did not cancel anything.
## Steps to Reproduce
1. Create a new Flutter app with `sdk: ^3.12.0` and `google_sign_in: ^7.2.0` and Firebase.
2. Call `GoogleSignIn.instance.initialize()` then
`GoogleSignIn.instance.authenticate()` on button press.
3. Run on an Android 14, API 34.
4. Tap the sign-in button.
## Expected Behavior
The Credential Manager dialog appears and lets the user pick a
Google account.
## Actual Behavior
- Status bar darkens briefly (transparent `HiddenActivity` is shown).
- No account picker or bottom sheet renders.
- After pressing back, `GoogleSignInExceptionCode.canceled` is thrown.
## Relevant Log Output
```
D/ActivityThread: ++ activityComponent: com.example.app/androidx.credentials.playservices.controllers.identityauth.HiddenActivity
D/TranActivityAppturboImpl: onResumeHork
D/VRI[HiddenActivity]: hardware acceleration = true
E/OpenGLRenderer: Unable to match the desired swap behavior.
I/flutter: Error occurred while signing in: GoogleSignInException(code GoogleSignInExceptionCode.canceled, activity is cancelled by the user., null)
D/BLASTBufferQueue: [VRI[HiddenActivity]#2] destructor()
W/PlayServicesImpl( 5416): Connection with Google Play Services was not successful. Connection result is: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null, clientMethodKey=null}
E/flutter ( 5416): [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: GoogleSignInException(code GoogleSignInExceptionCode.providerConfigurationError, getCredentialAsync no provider dependencies found - please ensure the desired provider dependencies are added, null)
E/flutter ( 5416): #0 GoogleSignInAndroid._authenticate (package:google_sign_in_android/google_sign_in_android.dart:231:9)
E/flutter ( 5416):
E/flutter ( 5416): #1 GoogleSignInAndroid.authenticate (package:google_sign_in_android/google_sign_in_android.dart:93:57)
E/flutter ( 5416):
E/flutter ( 5416): #2 GoogleSignIn.authenticate (package:google_sign_in/google_sign_in.dart:545:44)
E/flutter ( 5416):
E/flutter ( 5416):
```
## Device Information
| Field | Value |
|---|---|
| Android version | 14 (API 34) |
| Google Play Services | up to date |
| `google_sign_in` version | 7.2.0 |
| Flutter version | 3.44.0 |
code:
```
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'firebase_options.dart';
Future main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
await GoogleSignIn.instance.initialize();
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: true,
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State createState() => _MyHomePageState();
}
class _MyHomePageState extends State {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () async {
try {
await GoogleSignIn.instance.authenticate();
} catch (e) {
///...
}
},
child: const Text('SIGN IN'),
),
],
),
),
);
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.