title: In Android app Google Sign-In pop up does not load
body: <p>Whenever I try to sign in by launching the google sign-in intent, it directly goes to the onActivityResult without me having the chance to choose an account.
  All It does is dimm the screen, but the window to select an account doesn't show up.
  The Login then fails with this ApiException: </p>
  
  <pre><code>java.lang.ClassNotFoundException: com.google.android.gms.common.api.Scope
  </code></pre>
  
  <p>and</p>
  
  <pre><code>java.lang.RuntimeException: Canvas: trying to draw too large(256000000bytes) bitmap.
  </code></pre>
  
  <p>(full stack trace: <a href="https://pastebin.com/vBZeBLu0" rel="nofollow noreferrer">https://pastebin.com/vBZeBLu0</a>)</p>
  
  <p>All of my used dependencies are up to date and my credentials (oAuth client-id) are all set up correctly, I tried the solutions of other similar problems, but none of them solved my issue, i also checked if the user is logged out completely from the device and the issue kept reaccuring.</p>
  
  <p>This is my Log-in Activity:</p>
  
  <pre><code>public class Login extends Activity implements GoogleApiClient.OnConnectionFailedListener, GoogleApiClient.ConnectionCallbacks  {                                   
  
  private static final String TAG = "LoginProcess";
  
  SignInButton gsignInButton;
  private static final int RC_SIGN_IN = 1;
  DatabaseReference mRef;
  FirebaseAuth mAuth;
  FirebaseAuth.AuthStateListener mAuthListener;
  GoogleSignInOptions gso;
  GoogleApiClient mGoogleApiClient;
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.welcomescreenlogin);
  
      mAuth = FirebaseAuth.getInstance();
  
  
  
      gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
              .requestIdToken(getString(R.string.default_web_client_id))
              .requestEmail()
              .build();
  
      mGoogleSignInClient = GoogleSignIn.getClient(this, gso);
  
      gsignInButton = findViewById(R.id.sib);
  
      gsignInButton.setColorScheme(SignInButton.COLOR_DARK); // wide button style
      gsignInButton.setOnClickListener(myhandler);
  
  
  }
  
  View.OnClickListener myhandler = new View.OnClickListener() {
      public void onClick(View v) {
         signIn();
      }
  
  };
  
  
  
  public void signIn() {
  
      Intent signInIntent = mGoogleSignInClient.getSignInIntent();
      startActivityForResult(signInIntent, RC_SIGN_IN);
  }
  
  @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
  
      if (requestCode == RC_SIGN_IN) {
          Task&lt;GoogleSignInAccount&gt; task = GoogleSignIn.getSignedInAccountFromIntent(data);
          try {
              // Google Sign In was successful, authenticate with Firebase
              GoogleSignInAccount account = task.getResult(ApiException.class);
              firebaseAuthWithGoogle(account);
          } catch (ApiException e) {
              // Google Sign In failed, update UI appropriately
              Log.w(TAG, "Google sign in failed", e);  //this is where it always lands.
              Toast.makeText(this, "login failed", Toast.LENGTH_SHORT).show();
              // ...
          }
      }
  
  }
  </code></pre>
  
  <p>full code for Login Activity: <a href="https://pastebin.com/6Yi7vzD7" rel="nofollow noreferrer">https://pastebin.com/6Yi7vzD7</a></p>
  
  <p>Gradle:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 28
      buildToolsVersion '28.0.3'
  
      defaultConfig {
          applicationId "com.example.sanchez.worldgramproject"
          minSdkVersion 21
          targetSdkVersion 28
          multiDexEnabled true
          versionCode 0
          versionName "0"
  
  
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
          debug {
              debuggable true
          }
      }
  }
  
  
  
  dependencies {
  
      compile fileTree(dir: 'libs', include: ['*.jar'])
      api "com.google.android.material:material:1.0.0"
  
      implementation 'com.github.madrapps:pikolo:1.1.6'
      implementation 'com.google.android.gms:play-services-drive:16.0.0'
      implementation 'com.google.android.material:material:1.1.0-alpha02'
      implementation 'com.github.bumptech.glide:glide:3.8.0'
      implementation'com.firebaseui:firebase-ui-storage:2.3.0'
      implementation 'com.google.firebase:firebase-auth:16.1.0'
      implementation 'com.google.android.gms:play-services-auth:16.0.1'
      implementation 'androidx.appcompat:appcompat:1.0.2'
      implementation 'androidx.cardview:cardview:1.0.0'
      implementation 'androidx.recyclerview:recyclerview:1.0.0'
      implementation 'com.jakewharton:butterknife:8.8.1'
      implementation 'androidx.multidex:multidex:2.0.1'
      implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.6'
      implementation 'de.hdodenhof:circleimageview:2.2.0'
      implementation 'androidx.legacy:legacy-support-v4:1.0.0'
      implementation 'androidx.exifinterface:exifinterface:1.0.0'
      implementation 'com.google.firebase:firebase-storage:16.0.5'
      implementation 'com.google.android.gms:play-services-maps:16.0.0'
      implementation 'com.google.firebase:firebase-database:16.0.5'
      testImplementation 'junit:junit:4.12'
  
  }
  
  
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  
  <p>I have no idea what the cause of the problem is, how can i solve this issue and make the account selection window pop up?</p>
  
  <p><strong>EDIT 2.1.2019</strong></p>
  
  <p>Instead of the above ApiExeption i get this error:</p>
  
  <pre><code>W/LoginProcess: Google sign in failed
      com.google.android.gms.common.api.ApiException: 8: 
          at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(Unknown Source:4)
          at com.google.android.gms.auth.api.signin.GoogleSignIn.getSignedInAccountFromIntent(Unknown Source:8)
          at com.example.sanchez.worldgramproject.Login.onActivityResult(Login.java:162)
          at android.app.Activity.dispatchActivityResult(Activity.java:7548)
          at android.app.ActivityThread.deliverResults(ActivityThread.java:4485)
          at android.app.ActivityThread.handleSendResult(ActivityThread.java:4532)
          at android.app.ActivityThread.-wrap20(Unknown Source:0)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1752)
          at android.os.Handler.dispatchMessage(Handler.java:105)
          at android.os.Looper.loop(Looper.java:164)
          at android.app.ActivityThread.main(ActivityThread.java:6938)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
  </code></pre>
  
  <p>I believe something went wrong with how i set up my oAuth (Auto generated by Firebase)</p>