skip to Main Content

I’m getting the the Developer (Code:10, message:10:) error when trying to sign in using Google Sign-in while using FirebaseUI’s Authentication. All works well on development, but when I sign my bundle using my upload key and then run it on a device, it fails.

I looked at associated questions here, here and here and the answers didn’t help. As you’ll see below, I’ve tried their recommendations.

What I’ve tried:

  • Add SHA1 fingerprints to the Project Settings at the Firebase Console for debug, release (upload), and Google Play keys.
  • At console.developers.google.com, created OAuth clients for Android for each of the 3 keys.
  • Still at console.developers.google.com created a new Web client which I then took the Client ID and secret and put it under Firebase’s authentication / Google sign in method’s Web SDK configuration.
  • Tried all the steps here, here, here, and here
  • Double-checked that my build is actually signed by the correct key (the upload/deploy key)
  • Made sure my google-services.json is the latest with all fingerprints present

My app-level build.gradle file contains the following:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.gms.google-services'

android {

  signingConfigs {
    release {
      storeFile file('myKeystore')
      storePassword 'myPassword'
      keyAlias 'upload'
      keyPassword 'myPassword'
    }
  }
  compileSdkVersion 29

  defaultConfig {
    applicationId "com.######.app"
    minSdkVersion 28
    targetSdkVersion 29
    versionCode 24
    versionName "Test version 1"
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

    javaCompileOptions {
      annotationProcessorOptions {
        arguments = ["room.schemaLocation":
          "$projectDir/schemas".toString()
        ]
      }
    }
  }

  buildTypes {

    release {
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      signingConfig signingConfigs.release
    }

    debug {
      debuggable true
      signingConfig signingConfigs.debug
    }
  }

  packagingOptions {
    exclude 'META-INF/atomicfu.kotlin_module'
  }
  sourceSets {
    main {
      res {
        srcDirs 'src/main/res', 'src/main/res_birds'
      }
    }
  }
}

dependencies {
    // Jar libs
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    // Kotlin
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

    // Support libs
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.1.0'

    // Supernova UI Toolkit
    implementation 'io.supernova:android-ui-toolkit:1.2.0'

    // Play Services
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
    implementation 'com.google.android.gms:play-services-auth:18.0.0'

    // Page Control
    implementation 'com.romandanylyk:pageindicatorview:1.0.0'

    // Unit tests dependencies
    implementation 'com.google.firebase:firebase-auth:19.3.1'
    testImplementation 'junit:junit:4.13'

    // Integration tests dependencies
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    // Room components
    implementation "androidx.room:room-runtime:$rootProject.roomVersion"
    kapt "androidx.room:room-compiler:$rootProject.roomVersion"
    androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"

    // optional - Kotlin Extensions and Coroutines support for Room
    implementation "androidx.room:room-ktx:$rootProject.roomVersion"

    // Lifecycle components
    kapt "androidx.lifecycle:lifecycle-compiler:$rootProject.archLifecycleVersion"
    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$rootProject.archLifecycleVersion"

    // Kotlin components
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$rootProject.coroutines"
    api "org.jetbrains.kotlinx:kotlinx-coroutines-android:$rootProject.coroutines"

    // Material design
    implementation "com.google.android.material:material:$rootProject.materialVersion"

    // Testing
    testImplementation 'junit:junit:4.13'
    androidTestImplementation "androidx.arch.core:core-testing:$rootProject.coreTestingVersion"

    // Navigation
    implementation 'androidx.navigation:navigation-fragment-ktx:2.2.2'
    implementation 'androidx.navigation:navigation-ui-ktx:2.2.2'

    // Stfalcon ImageViewer
    implementation 'com.github.stfalcon:stfalcon-imageviewer:1.0.1'

    // [START gradle_firebase_ui_auth]
    implementation "com.firebaseui:firebase-ui-auth:6.2.1"

    //Firebase
    implementation 'com.google.firebase:firebase-analytics:17.4.3'
    implementation 'com.google.firebase:firebase-core:17.4.3'
    implementation 'com.google.firebase:firebase-firestore-ktx:21.4.3'
    implementation "com.google.firebase:firebase-auth-ktx:19.3.1"


    // Required only if Facebook login support is required
    implementation 'com.facebook.android:facebook-android-sdk:7.0.0'
    // [END gradle_firebase_ui_auth]

}

An extract from a log generated by a Firebase Test Lab device:

06-21 12:11:29.915: E/AuthUI(14514): A sign-in error occurred.
06-21 12:11:29.915: E/AuthUI(14514): com.firebase.ui.auth.FirebaseUiException: Code: 10, message: 10: 
06-21 12:11:29.915: E/AuthUI(14514):    at com.firebase.ui.auth.data.remote.GoogleSignInHandler.onActivityResult(GoogleSignInHandler.java:112)
06-21 12:11:29.915: E/AuthUI(14514):    at com.firebase.ui.auth.ui.idp.AuthMethodPickerActivity.onActivityResult(AuthMethodPickerActivity.java:361)
06-21 12:11:29.915: E/AuthUI(14514):    at android.app.Activity.dispatchActivityResult(Activity.java:7462)
06-21 12:11:29.915: E/AuthUI(14514):    at android.app.ActivityThread.deliverResults(ActivityThread.java:4391)
06-21 12:11:29.915: E/AuthUI(14514):    at android.app.ActivityThread.handleSendResult(ActivityThread.java:4440)
06-21 12:11:29.915: E/AuthUI(14514):    at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49)
06-21 12:11:29.915: E/AuthUI(14514):    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
06-21 12:11:29.915: E/AuthUI(14514):    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
06-21 12:11:29.915: E/AuthUI(14514):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
06-21 12:11:29.915: E/AuthUI(14514):    at android.os.Handler.dispatchMessage(Handler.java:106)
06-21 12:11:29.915: E/AuthUI(14514):    at android.os.Looper.loop(Looper.java:193)
06-21 12:11:29.915: E/AuthUI(14514):    at android.app.ActivityThread.main(ActivityThread.java:6718)
06-21 12:11:29.915: E/AuthUI(14514):    at java.lang.reflect.Method.invoke(Native Method)
06-21 12:11:29.915: E/AuthUI(14514):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
06-21 12:11:29.915: E/AuthUI(14514):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
06-21 12:11:29.916: D/LifecycleMonitor(14514): Lifecycle status change: com.firebase.ui.auth.KickoffActivity@f99b9c3 in: RESUMED
06-21 12:11:29.940: I/GoogleInputMethod(1463): onFinishInput() : Dummy InputConnection bound
06-21 12:11:29.940: I/GoogleInputMethod(1463): onStartInput() : Dummy InputConnection bound
06-21 12:11:29.945: I/Icing(10330): Indexing done com.google.android.inputmethod.latin-internal.3p:StickerPack [CONTEXT service_id=21 ]
06-21 12:11:29.946: I/Icing(10330): Indexing com.google.android.inputmethod.latin-internal.3p:Sticker from com.google.android.inputmethod.latin [CONTEXT service_id=21 ]
06-21 12:11:29.948: D/LifecycleMonitor(14514): Lifecycle status change: com.firebase.ui.auth.KickoffActivity@f99b9c3 in: PAUSED
06-21 12:11:29.962: I/FirebaseUIActivity(14514): Request Code: 123, Result Code: 0
06-21 12:11:29.962: E/FirebaseUIActivity(14514): Sign in failed with response error code: 4, and message: Code: 10, message: 10: 

In the screenshot below are my SHA-1 fingerprints on the Firebase console. They are defined as:

  • Ending with A7 : Debug
  • Ending with 68 : Release (apk)
  • Ending with 66 : Store (Play Store)

Firebase console SHA-1 fingerprints

When getting the signatures from key tool for release, I get:

SHA-1 from keytool

On Google play store, my upload certificate is shown as:

SHA-1 for google play upload key

On Google play store, the app signing certificate is shown as:

SHA-1 for google play signing

My OAuth 2 client for my upload key is shown as:

OAuth 2 client for upload key

My google-services.json contents are:

{
  "project_info": {
    "project_number": "*******",
    "firebase_url": "**********",
    "project_id": "************",
    "storage_bucket": "************"
  },
  "client": [
    {
      "client_info": {
        "mobilesdk_app_id": "1:77*******:android:*******1e7",
        "android_client_info": {
          "package_name": "com.f***********.app"
        }
      },
      "oauth_client": [
        {
          "client_id": "77************-2u******************.googleusercontent.com",
          "client_type": 1,
          "android_info": {
            "package_name": "com.f***********.app",
            "certificate_hash": "ea#####################################68"
          }
        },
        {
          "client_id": "7****************-do**************.googleusercontent.com",
          "client_type": 1,
          "android_info": {
            "package_name": "com.f***********.app",
            "certificate_hash": "3e#####################################a7"
          }
        },
        {
          "client_id": "7**************-k8**************.googleusercontent.com",
          "client_type": 1,
          "android_info": {
            "package_name": "com.f***********.app",
            "certificate_hash": "d0#####################################66"
          }
        },
        {
          "client_id": "7**************-sf**************.googleusercontent.com",
          "client_type": 3
        }
      ],
      "api_key": [
        {
          "current_key": "AI**************_GQ"
        }
      ],
      "services": {
        "appinvite_service": {
          "other_platform_oauth_client": [
            {
              "client_id": "7**************-sf**************.googleusercontent.com",
              "client_type": 3
            },
            {
              "client_id": "7*********-3**************.googleusercontent.com",
              "client_type": 2,
              "ios_info": {
                "bundle_id": "com.f***********.app",
                "app_store_id": "********"
              }
            }
          ]
        }
      }
    }
  ],
  "configuration_version": "1"
}

Any ideas where to look next will be appreciated.

2

Answers


  1. Chosen as BEST ANSWER

    So... It turns out that there are 4 (FOUR) signing keys that might be needed... The fourth one is for internal app sharing (which I was using) via Google Play. To find this key, you need to navigate to Google Play console as shown below:

    The mysterious missing key

    Add that key to your Firebase console settings, download the new google-services.json into your project and run.


  2. Check step 3 on this link
    It will resolve your problem.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search