I am using the google_sign_in plugin in a flutter app to sign in. Using code from the example The code for signing in is just:
GoogleSignIn _googleSignIn = new GoogleSignIn(
scopes: <String>[
'email',
'https://www.googleapis.com/auth/spreadsheets',
'https://www.googleapis.com/auth/drive.metadata',
],
);
Future<Null> _handleSignIn() async {
print("_handleSignIn");
try {
await _googleSignIn.signIn();
} catch (error) {
print("We failed");
print(error);
}
}
This works on Android. I press the signin button and there is a popup and I get to signin.
But, this simple example crashes on iOS. When the app calls _handleSignIn above, the _googleSignIn.signIn() call crashes the app (it goes away) with the error message:
flutter: _handleSignIn
*** First throw call stack:
(
0 CoreFoundation 0x000000010fe581e6 __exceptionPreprocess + 294
1 libobjc.A.dylib 0x000000010f4ed031 objc_exception_throw + 48
2 CoreFoundation 0x000000010fecd975 +[NSException raise:format:] + 197
3 Runner 0x000000010ce61d8b -[GIDSignIn signInWithOptions:] + 242
4 Runner 0x000000010ce5e777 -[GIDSignIn signIn] + 64
5 Runner 0x000000010ce591b2 -[FLTGoogleSignInPlugin handleMethodCall:result:] + 2114
6 Flutter 0x000000010d1af716 __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke + 118
7 Flutter 0x000000010d1c5370 _ZNK5shel<…>
Lost connection to device.
I have no experience building iOS apps so, I probably did something wrong. I followed the instructions and added the GoogleService-Info.plist from firebase.com and updated my Info.plist as instructed.
Any ideas? Any way to get a better error message so I can figure out what might be wrong?
