firebase/codelab-friendlychat-android

MainActivity crash because of 'the default_web_client_id string wasn't populated'

Ruineie opened this issue · 1 comments

I imported the completed project 'build-android'. It worked fine with the firebase simulator. After I built a real project on firebase and replaced mock-google-service.json with downloaded google-service.json, it started to crash.
ERROR MESSAGE

FATAL EXCEPTION: main
Process: com.google.firebase.codelab.friendlychat, PID: 4766
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:95)
...
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

what's wrong with it?

Error

at com.firebase.ui.auth.util.Preconditions.checkConfigured(Preconditions.java:95)
at com.firebase.ui.auth.AuthUI$IdpConfig$GoogleBuilder.validateWebClientId(AuthUI.java:1044)
at com.firebase.ui.auth.AuthUI$IdpConfig$GoogleBuilder.build(AuthUI.java:1114)
at com.google.firebase.codelab.friendlychat.SignInActivity.onStart(SignInActivity.kt:62)

Which occurs here in the SignInActivity.kt

       if (Firebase.auth.currentUser == null) {
            // Sign in with FirebaseUI, see docs for more details:
            // https://firebase.google.com/docs/auth/android/firebaseui
            val signInIntent = AuthUI.getInstance()
                    .createSignInIntentBuilder()
                    .setLogo(R.mipmap.ic_launcher)
                    .setAvailableProviders(listOf(
                            AuthUI.IdpConfig.EmailBuilder().build(),
                            AuthUI.IdpConfig.GoogleBuilder().build(),   // here comes the error
                    ))
                    .build()

            signIn.launch(signInIntent)
        } else {
            goToMainActivity()
        }