2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

FlutterでGoogle sign in使おうとしたら、iOSでクラッシュし続ける

Last updated at Posted at 2020-09-19

iOSでFlutterのgoogle_sign_inが動かない...

Flutterのfirebase_authgoogle_sign_inで、Google sing inを実装していた。
Android側は問題なく動いたが、iOSがどうにも動かない。

GoogleSignIn().signIn()signIn()でクラッシュする。

FlutterFireのiOS Installationを舐めるように読み返してみても解決しない。

  • google_sign_in: 4.5.3
  • iOS: 10.3.1

解決策

GoogleSignIn( scopes: ['email', 'profile'], hostedDomain: '', clientId: '',).signIn();

GitHub issueで解決策見つけた。
https://github.com/flutter/flutter/issues/44564#issuecomment-575883100
どうやらライブラリで、パラメータのnullチェックが足りてないらしい。

もっと少ないパラメータで大丈夫だった人も。
https://github.com/flutter/flutter/issues/44564#issuecomment-655884103

他のハマりポイント

先のissueをみてると、設定漏れでハマってる人もちらほら。

https://pub.dev/packages/google_sign_in#ios-integration
ここにある通り、

  1. GoogleService-Info.plistをFirebaseコンソールからDLして、[my_project]/ios/Runnerに追加する。
  2. CFBundleURLTypesInfo.plistに追記する。
  3. この時、stringタグの中身を、先のGoogleService-Info.plistに書いてあるREVERSED_CLIENT_IDで置き換える。

...のをお忘れなく。

2
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?