I implemented the google sign in api in my android app. Everything was fine until recently. One of the challenges I had was with client\_id which regenerated. The most recent that has opened more errors is that the google sign in wont work in the release.apk that built.

After two days of debugging I decided to create a new demo project to start the process afresh. It won't work as the task return `false` for `task.isSuccessful`.

Perhaps there is something I am missing.

```
const val RC_SIGN_IN = 0
class MainActivity : AppCompatActivity() {
    lateinit var observer:StartActivityForResults
    private lateinit var mGoogleSignInClient:GoogleSignInClient
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        observer = StartActivityForResults(activityResultRegistry)
        lifecycle.addObserver(observer)

        val gso = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                .requestEmail()
                .build()

        mGoogleSignInClient = GoogleSignIn.getClient(this, gso);

        sign_in_button.setOnClickListener{
            signIn()
        }
    }

    private fun signIn() {

        val signInIntent = mGoogleSignInClient.signInIntent

        startActivityForResult(signInIntent, RC_SIGN_IN)
    }

    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)

        // Result returned from launching the Intent from GoogleSignInClient.getSignInIntent(...);
        if (requestCode == RC_SIGN_IN) {
            // The Task returned from this call is always completed, no need to attach
            // a listener.
            val task = Auth.GoogleSignInApi.getSignInResultFromIntent(data)

            task?.isSuccess

            Toast.makeText(this, "Success", Toast.LENGTH_LONG).show()
        }
        else{
            Log.i("title", "OKCODE ${Activity.RESULT_OK} RESULTCODE ${resultCode}")
        }
    }
}

```