title: I'm trying to implement the google sign in android but nothing happens whenever I press sign In. There's no errors whenever I run it
body: <p>I've been trying to apply the google sign in function into my application however, after copying the same exact code that is indicated in the site of google, nothing happens whenever I press the sign in button. Please help me.. I've been in this roadblock for almost two days already</p>
  <p>Here is my code</p>
  <pre><code>class MainActivity : AppCompatActivity() {
  
  //view binding
  private lateinit var binding: ActivityMainBinding
  private lateinit var googleSignInClient: GoogleSignInClient
  private lateinit var firebaseAuth: FirebaseAuth
  
  //constants
  private companion object {
      private const val RC_GOOGLE_SIGN_IN = 100
      private const val TAG = &quot;GOOGLE_SIGN_IN_TAG&quot;
  }
  
  override fun onCreate(savedInstanceState: Bundle?) {
      super.onCreate(savedInstanceState)
      binding = ActivityMainBinding.inflate(layoutInflater)
  
      setContentView(binding.root)
  
      //configure the google sign in
      val googleSignInOptions = 
  GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
      .requestIdToken(&quot;I don't know if I'm supposed to show this&quot;)
      .requestEmail()
      .build()
  
  googleSignInClient = GoogleSignIn.getClient(this, googleSignInOptions)
  
  firebaseAuth = FirebaseAuth.getInstance()
  checkUser()
  
  binding.googleSignInBtn.setOnClickListener {
      Log.d(TAG, &quot;onCreate: begin Google SignIn&quot;)
      val intent = googleSignInClient.signInIntent
      startActivityForResult(intent, RC_GOOGLE_SIGN_IN)
     }
  }
  
  private fun checkUser() {
      //check if user is logged in or not
      val firebaseUser = firebaseAuth.currentUser
      if (firebaseUser != null) {
          //user is already logged in
          //start profile activity
          startActivity(Intent(this@MainActivity, ProfileActivity::class.java))
          finish()
  
      }
  }
  
  override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
      super.onActivityResult(requestCode, resultCode, data)
  
      if (requestCode == RC_GOOGLE_SIGN_IN) {
          Log.d(TAG, &quot;onActivityResult: Google SignIn intent result&quot;)
          val accountTask = GoogleSignIn.getSignedInAccountFromIntent(data)
  
          try {
              //Google SignIn success, now auth with firebase
              val account = accountTask.getResult(ApiException::class.java)
              firebaseAuthWithGoogleAccount(account)
          } catch (e: Exception) {
              //failed Google SignIn
              Log.d(TAG, &quot;onActivityResult: ${e.message}&quot;)
          }
      }
  }
  
  private fun firebaseAuthWithGoogleAccount(account: GoogleSignInAccount?) {
      Log.d(TAG, &quot;firebaseAuthWithGoogleAccount: begin firebase auth with google account&quot;)
  
      val credential = GoogleAuthProvider.getCredential(account!!.idToken, null)
      firebaseAuth.signInWithCredential(credential)
          .addOnSuccessListener { authResult -&gt;
              //login success
              Log.d(TAG, &quot;firebaseAuthWithGoogleAccount: LoggedIn&quot;)
  
              //get loggedIn user
              val firebaseUser = firebaseAuth.currentUser
  
              //get user info
              val uid = firebaseUser!!.uid
              val email = firebaseUser!!.email
  
              Log.d(TAG, &quot;firebaseAuthWithGoogleAccount: Uid: $uid&quot;)
              Log.d(TAG, &quot;firebaseAuthWithGoogleAccount: Email: $email&quot;)
  
              //check if user is now new or existing
  
              if (authResult.additionalUserInfo!!.isNewUser) {
                  //user is new - Account created
                  Log.d(TAG, &quot;firebaseAuthWithGoogleAccount: Account created... \n$email&quot;)
                  Toast.makeText(
                  this@MainActivity,
                  &quot;Account created... \n$email&quot;,
                  Toast.LENGTH_SHORT
              ).show()
          } else {
              //existing user -- LoggedIn
              Log.d(TAG, &quot;firebaseAuthWithGoogleAccount: Existing user... \n$email&quot;)
              Toast.makeText(this@MainActivity, &quot;LoggedIn... \n$email&quot;, Toast.LENGTH_SHORT)
                  .show()
          }
  
          //start profile activity
          startActivity(Intent(this@MainActivity, ProfileActivity::class.java))
  
      }
      .addOnFailureListener { e -&gt;
          //login failed
          Log.d(TAG, &quot;firebaseAuthWithGoogleAccount: Log in Failed due to ${e.message}&quot;)
          Toast.makeText(
              this@MainActivity,
              &quot;Loggin Failed due to ${e.message}&quot;,
              Toast.LENGTH_SHORT
          ).show()
      }
    }
  }
  </code></pre>
  <p>here is my project gradle</p>
  <pre><code>// Top-level build file where you can add configuration options common to all sub- 
  projects/modules.
  buildscript {
  repositories {
      google()
      mavenCentral()
  }
  dependencies {
      classpath 'com.android.tools.build:gradle:7.0.3'
      classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31&quot;
      classpath 'com.google.gms:google-services:4.3.10'
  
     }
  }
  
  
  task clean(type: Delete) {
  delete rootProject.buildDir
  }
  </code></pre>
  <p>here is my build gradle</p>
  <pre><code>plugins {
      id 'com.android.application'
      id 'kotlin-android'
      id 'com.google.gms.google-services'
      id 'kotlin-android-extensions'
  }
  
  android {
     compileSdk 30
  
  defaultConfig {
      applicationId &quot;com.example.firebaseapplication&quot;
      minSdk 22
      targetSdk 30
      versionCode 1
      versionName &quot;1.0&quot;
  
      testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
  }
  
  buildTypes {
      release {
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 
  'proguard-rules.pro'
      }
  }
  compileOptions {
      sourceCompatibility JavaVersion.VERSION_1_8
      targetCompatibility JavaVersion.VERSION_1_8
  }
  kotlinOptions {
      jvmTarget = '1.8'
  }
  
  //enable viewBinding
  buildFeatures {
      viewBinding true
  }
  }
  
  dependencies {
  
      implementation 'androidx.core:core-ktx:1.6.0'
      implementation 'androidx.appcompat:appcompat:1.3.1'
      implementation 'com.google.android.material:material:1.4.0'
      implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
      implementation 'com.google.firebase:firebase-auth:21.0.1'
      testImplementation 'junit:junit:4.13.2'
      androidTestImplementation 'androidx.test.ext:junit:1.1.3'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
  
  
     // Import the BoM for the Firebase platform
    implementation platform('com.google.firebase:firebase-bom:28.4.2')
  
    // Declare the dependency for the Firebase Authentication library
    // When using the BoM, you don't specify versions in Firebase library dependencies
    implementation 'com.google.firebase:firebase-auth-ktx'
  
    // Also declare the dependency for the Google Play services library and specify its 
     version
     implementation 'com.google.android.gms:play-services-auth:19.2.0'
  
  }
  
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  <p>Here is my activity main.xml</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  
  &lt;RelativeLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
  xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
  xmlns:tools=&quot;http://schemas.android.com/tools&quot;
  android:layout_width=&quot;match_parent&quot;
  android:layout_height=&quot;match_parent&quot;
  android:padding=&quot;20dp&quot;
  tools:context=&quot;.MainActivity&quot;&gt;
  
  &lt;ImageView
      android:id=&quot;@+id/icon&quot;
      android:layout_width=&quot;200dp&quot;
      android:layout_height=&quot;200dp&quot;
      android:src=&quot;@drawable/background&quot;
      android:layout_centerHorizontal=&quot;true&quot; /&gt;
  
  &lt;TextView
      android:id=&quot;@+id/captionTv&quot;
      android:layout_width=&quot;wrap_content&quot;
      android:layout_height=&quot;wrap_content&quot;
      android:layout_centerHorizontal=&quot;true&quot;
      android:text=&quot;Welcome to Google Sign In&quot;
      style=&quot;@style/TextAppearance.MaterialComponents.Body1&quot;
      android:layout_below=&quot;@id/icon&quot; /&gt;
  
  &lt;!-- Google SignIn Button --&gt;
  
  &lt;com.google.android.gms.common.SignInButton
      android:id=&quot;@+id/googleSignInBtn&quot;
      android:layout_width=&quot;wrap_content&quot;
      android:layout_height=&quot;wrap_content&quot;
      android:layout_centerInParent=&quot;true&quot;/&gt;
  
  
  
  
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  <p>It successfully builds the project without any errors however, i don't get any response whenever I click the google sign-in button.</p>