the default_web_client_id string wasn't populated
Using these libraries:
implementation 'com.firebaseui:firebase-ui-auth:4.1.0' implementation 'com.google.firebase:firebase-auth:16.0.1' implementation 'com.google.android.gms:play-services-auth:15.0.1'
And this code:
`AuthUI.IdpConfig googleIdp = new AuthUI.IdpConfig.GoogleBuilder().build(); AuthUI.IdpConfig facebookIdp = new AuthUI.IdpConfig.FacebookBuilder().build(); AuthUI.IdpConfig emailIdp = new AuthUI.IdpConfig.EmailBuilder().build(); //not signed in startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setAvailableProviders(Arrays.asList(facebookIdp, emailIdp))
.setIsSmartLockEnabled(false)
.setLogo(R.mipmap.app_icon)
.build(),
RC_SIGN_IN);`
@Sutheres that string comes from the google-services.json file and the google-services plugin. It's sort of tangential to FirebaseUI. If you're having trouble, re-download the json file theres a tiny chance you got a corrupted one.
@samtstern re-downloaded, still no luck! any other ideas?
@Sutheres can you show the error you're getting? And can you try the following:
From the command line, run ./gradlew :app:assembleDebug, then run cat app/build/generated/res/google-services/debug/values/values.xml
@samtstern Here is full error:
java.lang.RuntimeException: Unable to resume activity {com.solofunds.soloandroid/com.solofunds.soloandroid.LoginActivity}: java.lang.IllegalStateException: Check your google-services plugin configuration, the default_web_client_id string wasn't populated.
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3581)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3621)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2862)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.IllegalStateException: Check your google-services plugin configuration, the default_web_client_id string wasn't populated.
at com.firebase.ui.auth.util.Preconditions.checkConfigured(Preconditions.java:90)
at com.firebase.ui.auth.AuthUI$IdpConfig$GoogleBuilder.<init>(AuthUI.java:852)
at com.solofunds.soloandroid.LoginActivity.onResume(LoginActivity.java:93)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1355)
at android.app.Activity.performResume(Activity.java:7117)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3556)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3621)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2862)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
I tried running ./gradlew :app:assembleDebug in the android studio terminal but I got this message back:
`ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the location of your Java installation.`
So, I ended up opening the Gradle side pane to app -> build -> assembleDebug. I have output from that I can post? Wasnt sure how to run the cat command since I couldnt run the gradle command in the AS terminal correctly
Running assembleDebug in Android Studio and then running the cat command in your terminal after should work, thanks!
@samtstern Okay, it worked. I ran it and got some values back within a
@Sutheres could you just show me the whole output you got?
@samtstern
1:43:29 PM: Executing task 'assembleDebug'...
Executing tasks: [assembleDebug]
Configuration on demand is an incubating feature. registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug] registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull, src/nullnull, src/release, src/nullnullRelease] registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) app: 'annotationProcessor' dependencies won't be recognized as kapt annotation processors. Please change the configuration name to 'kapt' for these artifacts: 'com.github.bumptech.glide:compiler:4.7.1' and apply the kapt plugin: "apply plugin: 'kotlin-kapt'". :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:compileDebugAidl UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE :app:checkDebugManifest UP-TO-DATE :app:generateDebugBuildConfig UP-TO-DATE :app:mainApkListPersistenceDebug UP-TO-DATE :app:mergeDebugShaders UP-TO-DATE :app:compileDebugShaders UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets :app:processDebugGoogleServices Parsing json file: /home/ed/StudioProjects/solo-android/app/google-services.json :app:createDebugCompatibleScreenManifests UP-TO-DATE :app:processDebugManifest UP-TO-DATE :app:fabricGenerateResourcesDebug :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources UP-TO-DATE :app:mergeDebugResources :app:splitsDiscoveryTaskDebug UP-TO-DATE :app:processDebugResources :app:compileDebugKotlin UP-TO-DATE :app:prepareLintJar UP-TO-DATE :app:generateDebugSources :app:javaPreCompileDebug UP-TO-DATE :app:compileDebugJavaWithJavac UP-TO-DATE :app:compileDebugNdk NO-SOURCE :app:compileDebugSources UP-TO-DATE :app:transformClassesWithDexBuilderForDebug UP-TO-DATE :app:transformDexArchiveWithExternalLibsDexMergerForDebug UP-TO-DATE :app:transformDexArchiveWithDexMergerForDebug UP-TO-DATE :app:mergeDebugJniLibFolders UP-TO-DATE :app:transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE :app:processDebugJavaRes NO-SOURCE :app:transformResourcesWithMergeJavaResForDebug UP-TO-DATE :app:validateSigningDebug UP-TO-DATE :app:packageDebug :app:assembleDebug
BUILD SUCCESSFUL in 26s 29 actionable tasks: 6 executed, 23 up-to-date 1:43:58 PM: Task execution finished 'assembleDebug'.
$cat app/build/generated/res/google-services/debug/values/values.xml
Hmmm yeah something is going wrong in your project, here's what mine looks like:
$ cat app/build/generated/res/google-services/debug/values/values.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="default_web_client_id" translatable="false">241316263954-vlja3di1tbnkv93jhhq5cfdsv3tr28sq.apps.googleusercontent.com</string>
<string name="firebase_database_url" translatable="false">https://firuidemo.firebaseio.com</string>
<string name="gcm_defaultSenderId" translatable="false">241316263954</string>
<string name="google_api_key" translatable="false">AIzaSyD9XazjNUzmnJXEPpgokdLGuv6XlOdtTAU</string>
<string name="google_app_id" translatable="false">1:241316263954:android:91eecf4730fc920b</string>
<string name="google_crash_reporting_api_key" translatable="false">AIzaSyD9XazjNUzmnJXEPpgokdLGuv6XlOdtTAU</string>
<string name="google_storage_bucket" translatable="false">firuidemo.appspot.com</string>
<string name="project_id" translatable="false">firuidemo</string>
</resources>
As you can see that file should be a bunch of string resources. What version of the com.google.gms:google-services plugin are you using?
@samtstern apologies! i must have pasted the results improperly. Here is what I have:
`$ cat app/build/generated/res/google-services/debug/values/values.xml
<resources>
<string name="firebase_database_url" translatable="false">https://solo-funds-production.firebaseio.com</string>
<string name="gcm_defaultSenderId" translatable="false">716756156896</string>
<string name="google_api_key" translatable="false">AIzaSyCr_lxlbImIvrhIG1bscqymz4PtoOwsWFI</string>
<string name="google_app_id" translatable="false">1:716756156896:android:e65b7a8838b7df40</string>
<string name="google_crash_reporting_api_key" translatable="false">AIzaSyCr_lxlbImIvrhIG1bscqymz4PtoOwsWFI</string>
<string name="google_storage_bucket" translatable="false">solo-funds-production.appspot.com</string>
<string name="project_id" translatable="false">solo-funds-production</string>
</resources>`
also, I am using classpath 'com.google.gms:google-services:4.0.1'
@samtstern seems like ur getttin default_web_client_id in your output and im not, which is causing my issue!
@Sutheres huh that's really strange! Looks like your project was not created properly (maybe a bug).
Ok you need to open the Google Cloud console (not the Firebase console) and go to your project. Then go to APIs and Services and open the Credentials section. Here's what I see:

I assume that yours does not have any Web Client IDs, so let's make a new one. Here's the configuration mine has:

Replace fir-dumpster in my image with your project ID in all cases.
Finally, re-download your google-services.json and it should have the fields you need.
@samtstern I also have a default web client in my google cloud console

Should I still recreate one? I also saw this in configs.xml of the FirebaseUI auth code:

Could this mean its a gradle issue at all?
@Sutheres sorry about the huge delay here, I was out on vacation for a week.
I would recommend a few things:
- Create a string in your app with the name
default_web_client_idand the value being the "Web client (auto created by Google Service)" id from the console. This will unblock you for now. - File an issue with Firebase support. Explain to them that even though your project has a web client ID, your
google-servicesconfiguration is not creating the proper string resources. You can link to this issue and say that we both suspect there is a bug here (I don't think this is user error)
@samtstern
I have submitted a ticket to firebase in the meantime and they've already reached out and confirmed this is a bug on their end, so I'll be checking the release notes from here on out. And creating the string in the app is indeed working as a temporary fix so thanks for everything!!
@Sutheres glad to hear it! Closing the issue here, thanks so much for your patience.
I had this problem too. To solve, I just updated the classpath 'com.google.gms:google-services:4.2.0' inside the build.gradle file of the project.
Thank you Ed Sutherlin. I had this problem. To solve, I just updated the dependencies implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
Hi @Sutheres @samtstern do you have any update on this issue?
I am getting following exception
2019-04-03 18:07:18.608 19787-19787/com.example.textonphotos E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.textonphotos, PID: 19787
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.textonphotos/com.example.textonphotos.screens.home.HomeActivity}: java.lang.IllegalStateException: Check your google-services plugin configuration, the default_web_client_id string wasn't populated.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.IllegalStateException: Check your google-services plugin configuration, the default_web_client_id string wasn't populated.
at com.firebase.ui.auth.util.Preconditions.checkConfigured(Preconditions.java:90)
at com.firebase.ui.auth.AuthUI$IdpConfig$GoogleBuilder.<init>(AuthUI.java:852)
at com.example.textonphotos.screens.login.LoginFragment.onActivityCreated(LoginFragment.kt:78)
at androidx.fragment.app.Fragment.performActivityCreated(Fragment.java:2461)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:908)
at androidx.fragment.app.FragmentManagerImpl.addAddedFragments(FragmentManagerImpl.java:2078)
at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1852)
at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1808)
at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1709)
at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManagerImpl.java:2609)
at androidx.fragment.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManagerImpl.java:2565)
at androidx.fragment.app.Fragment.performActivityCreated(Fragment.java:2467)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:908)
at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1229)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1295)
at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManagerImpl.java:2605)
at androidx.fragment.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManagerImpl.java:2565)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:245)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:525)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:179)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1334)
at android.app.Activity.performStart(Activity.java:7029)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2741)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Here is startActivity code
startActivityForResult(AuthUI.getInstance().createSignInIntentBuilder().setAvailableProviders(arrayListOf(
AuthUI.IdpConfig.EmailBuilder().build(),
AuthUI.IdpConfig.GoogleBuilder().build()))
.build(), RC_SIGN_IN)
I am using following gradle dependencies
project level
ext.firebase_core_version = "16.0.8"
ext.firebase_auth_version = "16.2.0"
ext.firebase_database_version = "16.1.0"
ext.firebase_storage_version = "16.1.0"
classpath 'com.google.gms:google-services:4.2.0' // Google Services plugin
app level
implementation 'com.firebaseui:firebase-ui-auth:4.3.2'
// firebase
implementation "com.google.firebase:firebase-core:$firebase_core_version"
implementation "com.google.firebase:firebase-auth:$firebase_auth_version"
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation "com.google.firebase:firebase-database:$firebase_database_version"
implementation "com.google.firebase:firebase-storage:$firebase_storage_version"
}apply plugin: 'com.google.gms.google-services' // Google Play services Gradle plugin
@rajasone updating to all the latest libraries solved my issue. I haven't seen this happen for a while now