title: Android App with Google Drive API stucks after choosing an account. Why?
body: <p>I'm trying to understand how I can integrate Google Drive API in my Android App(using Android Studio). I have tried the example app that I found here(<a href="https://github.com/googleworkspace/android-samples/tree/master/drive/deprecation" rel="nofollow noreferrer">https://github.com/googleworkspace/android-samples/tree/master/drive/deprecation</a>) but after Google API console configuration my app stucks in an infinite loop when I choose an Account. Why? Where is the problem?
  I tried also with this(<a href="https://youtu.be/5bSEIQYJzKs" rel="nofollow noreferrer">https://youtu.be/5bSEIQYJzKs</a>) tutorial but I have the same problem.
  Here my build.gradle specific lines:</p>
  <pre><code>implementation &quot;androidx.multidex:multidex:2.0.1&quot;
  implementation 'com.google.android.gms:play-services-auth:19.0.0'
  implementation ('com.google.apis:google-api-services-drive:v3-rev136-1.25.0')
              {
                  exclude group: 'org.apache.httpcomponents'
              }
  implementation ('com.google.api-client:google-api-client-android:1.26.0')
              {
                  exclude group: 'org.apache.httpcomponents'
              }
  implementation 'com.google.http-client:google-http-client-gson:1.26.0'
  </code></pre>
  <p>and here is the version that I use</p>
  <pre><code>compileSdkVersion 30
  buildToolsVersion &quot;30.0.3&quot;
  </code></pre>
  <p>The problem is in this code lines, and occurs only if I use &quot;.requestScopes(new Scope(DriveScopes.DRIVE_FILE))&quot;:
  if i donot use .requestScopes(new Scope(DriveScopes.DRIVE_FILE))&quot;, then code works fine. and user do get logedin</p>
  <pre><code>GoogleSignInOptions signInOptions = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                  .requestScopes(new Scope(DriveScopes.DRIVE_FILE))
                  .requestEmail()
                  .build();
  GoogleSignInClient client= GoogleSignIn.getClient(this,signInOptions);
  Intent i= client.getSignInIntent();
  startActivityForResult(i,400);
  </code></pre>
  <p>(it seems like the activity never returns any value).
  Without &quot;.requestScopes(new Scope(DriveScopes.DRIVE_FILE))&quot; the auth request is successful.
  Here my Google console configuration:
  <a href="https://i.stack.imgur.com/yHTaR.png" rel="nofollow noreferrer">The client ID</a>
  (sorry, maybe it will appear as a link but stackOverflow tell me that I can't put img)
  and
  &quot;.../auth/drive.file&quot; is the authorization that I request in google Consent window that appears to the user.
  I don't know if it is important to say but I use a real phone and not the Android Studio emulator to test my app.</p>