0
0

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 1 year has passed since last update.

gms.common.api.ApiException:10と12500の対処法

Posted at

新しいプロジェクトを作成したときにハマってしまいました。
対処法のメモです。

エラーメッセージ

sign_in_failed com.google.android.gms.common.api.ApiException: 10
sign_in_failed com.google.android.gms.common.api.ApiException: 12500
  • 10の場合
    Firebase フィンガープリント
  • 12500の場合
    GCP OAuth 同意画面
    Firebase サポートメール
    GCP API 有効

Firebase フィンガープリント

ApiException: 10 の場合
フィンガープリントとは開発PCで実行すると出力されるハッシュ値(SHA1)のことです。
他人が勝手にAPKを差替えられないようにするのが目的です(たぶん)

Step1 構成ファイルをアプリに同梱

  1. Firebase にログインします。
    https://console.firebase.google.com/u/0/
  2. プロジェクトを作成します。
  3. アプリを追加します。
  4. 以下の構成ファイルをダウンロードします。
    google-services.json (android)
    GoogleService-Info.plist (ios)
  5. 構成ファイルを Flutter プロジェクトにコピーします。
    :file_folder:android
    :open_file_folder:app
      :notebook:build.gradle
      :notebook:google-service.json :arrow_left::arrow_left:
    :file_folder:ios
    :file_folder:Flutter
    :file_folder:Runner
      :notebook:AppDelegate.swift
      :notebook:GoogleService-Info.plist :arrow_left::arrow_left:
      :notebook:Info.plist

Step2 ハッシュ値をFirebaseに登録

cd android
gradlew signingReport (または gradle signingReport)
  1. androidフォルダでコマンドを実行します。
    成功するといっぱい出てきますが SHA1 は同じ値です。
  2. FIrebaseのアプリにSHA1を登録します。
  • 注:別のPCでビルドすると、そのPCのハッシュ登録が必要になります。

GCP OAuth 同意画面

ApiException: 12500 の場合

  1. GCP (Google Cloud Platform) にログインします。
  2. Firebaseで作成したプロジェクトがGCPにも作成されているので、それを選びます。
  3. OAuth同意画面の「アプリを編集」で編集します。

Firebase サポートメール

ApiException: 12500 の場合

  • プロジェクトの設定(SHA1を設定したページ)でサポートメールを設定します。
    この情報はネットで検索すると出てきました。私は登録済なので未検証です。

GCP API 有効

ApiException: 12500 の場合

  • GCPでAPIの有効無効を確認します。
    私の場合は Google Drive API を使うのでそれを有効にします。
    ちなみに無効にしてもできました。ダメ元です。

あとがき

新しいプロジェクトを作成したときにハマりました。フィンガープリントは知っていましたが、OAuth 同意画面はいつのまにかやっていたのでしょう。AWS も GCP もこの手のごにょごにょが多いですね。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?