googleworkspace / android-samples

Android samples for Google Workspace APIs
Apache License 2.0
635 stars 410 forks source link

Problem in running android-demos - Login can never success. #43

Closed yccheok closed 8 years ago

yccheok commented 8 years ago

I found out I can never run the android-demos successful

I running code with last commit - https://github.com/googledrive/android-demos/commit/4f57857ee10d94fabc4e381d39795eb8cd71b93d

Whenever I choose an item, says "Create a file in App Folder",

the following login dialog box will pop up

enter image description here

Whenever I select my account for example, the dialog will close for few seconds, and then re-appear again.

My logging message is as follow

01-09 11:36:32.783 25040-25040/? I/art: Late-enabling -Xcheck:jni
01-09 11:36:32.897 25040-25040/com.google.android.gms.drive.sample.demo W/System: ClassLoader referenced unknown path: /data/app/com.google.android.gms.drive.sample.demo-2/lib/arm
01-09 11:36:33.056 25040-25068/com.google.android.gms.drive.sample.demo D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
01-09 11:36:33.118 25040-25068/com.google.android.gms.drive.sample.demo I/Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 10/21/15, 369a2ea, I96aee987eb
01-09 11:36:33.122 25040-25068/com.google.android.gms.drive.sample.demo I/OpenGLRenderer: Initialized EGL, version 1.4
01-09 11:36:36.898 25040-25040/com.google.android.gms.drive.sample.demo I/BaseDriveActivity: GoogleApiClient connection failed: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{d9ab090: android.os.BinderProxy@c093d89}, message=null}
01-09 11:36:36.909 25040-25046/com.google.android.gms.drive.sample.demo W/art: Suspending all threads took: 11.169ms
01-09 11:36:48.094 25040-25040/com.google.android.gms.drive.sample.demo I/BaseDriveActivity: GoogleApiClient connection failed: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{a2c01a8: android.os.BinderProxy@c093d89}, message=null}
01-09 11:36:49.664 25040-25040/com.google.android.gms.drive.sample.demo I/BaseDriveActivity: GoogleApiClient connection failed: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{860b3a7: android.os.BinderProxy@c093d89}, message=null}
01-09 11:36:51.105 25040-25040/com.google.android.gms.drive.sample.demo I/BaseDriveActivity: GoogleApiClient connection failed: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{fdcd0f2: android.os.BinderProxy@c093d89}, message=null}
01-09 11:36:52.529 25040-25040/com.google.android.gms.drive.sample.demo I/BaseDriveActivity: GoogleApiClient connection failed: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{dbf9af9: android.os.BinderProxy@c093d89}, message=null}
01-09 11:36:53.770 25040-25040/com.google.android.gms.drive.sample.demo I/BaseDriveActivity: GoogleApiClient connection failed: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{e095ec: android.os.BinderProxy@c093d89}, message=null}
01-09 11:36:55.085 25040-25040/com.google.android.gms.drive.sample.demo I/BaseDriveActivity: GoogleApiClient connection failed: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{82377bb: android.os.BinderProxy@c093d89}, message=null}
01-09 11:36:56.734 25040-25040/com.google.android.gms.drive.sample.demo I/BaseDriveActivity: GoogleApiClient connection failed: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{a542316: android.os.BinderProxy@c093d89}, message=null}

Even if I press the back button, the login dialog will disappear for few seconds, then re-appear again

01-09 11:37:30.704 25040-25040/com.google.android.gms.drive.sample.demo I/BaseDriveActivity: GoogleApiClient connection failed: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{6b2333: android.os.BinderProxy@c093d89}, message=null}
01-09 11:37:31.568 25040-25040/com.google.android.gms.drive.sample.demo I/BaseDriveActivity: GoogleApiClient connection failed: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{847eee: android.os.BinderProxy@c093d89}, message=null}
01-09 11:37:32.964 25040-25040/com.google.android.gms.drive.sample.demo I/BaseDriveActivity: GoogleApiClient connection failed: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{c1eae25: android.os.BinderProxy@c093d89}, message=null}
01-09 11:37:34.252 25040-25040/com.google.android.gms.drive.sample.demo I/BaseDriveActivity: GoogleApiClient connection failed: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{8a97408: android.os.BinderProxy@c093d89}, message=null}
01-09 11:37:34.999 25040-25040/com.google.android.gms.drive.sample.demo I/BaseDriveActivity: GoogleApiClient connection failed: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{ff11187: android.os.BinderProxy@c093d89}, message=null}
01-09 11:37:35.754 25040-25040/com.google.android.gms.drive.sample.demo I/BaseDriveActivity: GoogleApiClient connection failed: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{43fb052: android.os.BinderProxy@c093d89}, message=null}

I do have a valid Google Drive account.

My device is Nexus 5, Android version 6.0.1

May I know is this bug from code example, or something wrong with my device settings?

I compile the code using Android studio 1.5.1, with all tools and sdk up-to-date.

iuribtt commented 8 years ago

Try to use "keytool -exportcert -alias androiddebugkey -keystore C:\Users\XXXXX.android\debug.keystore -list -v" and not the keystore that you generate, once you want the debug mode.

The path for the "debug.keystore" and the password is "android" https://support.google.com/cloud/answer/6158849?hl=en#android

And after that create the project in https://developers.google.com/mobile/add

Finally, enable the Drive API in the https://console.developers.google.com

AndroidDeveloperLB commented 8 years ago

@iuribtt Can it work in debug mode too, or does it have to be signed? Your first url is broken. What should I do with the output of the command you wrote?

iuribtt commented 8 years ago

Hello @AndroidDeveloperLB, it can work in debug mode as well. Please copy and past the URL in another tab on your browser. Otherwise the github will try to find internally.

AndroidDeveloperLB commented 8 years ago

@iuribtt Is it possible to use Drive API without being registered and without having a published app?

iuribtt commented 8 years ago

You don't need to publish the App, debug mode is for that, but I believe that you need to being registered in some way.

AndroidDeveloperLB commented 8 years ago

I see. OK.

mruijzendaal commented 7 years ago

Do you need to create an API Key or OAuth key with the package name and SHA-1? Do you enter that data into the manifest like in Google Maps, or with a different tag (so not com.google.android.geo.API_KEY)?

vwithv1602 commented 6 years ago

Hi, I'm using GoogleAPIClient and can successfully login to google account while running in debug mode. But when I generate a signed apk and publish it to play store, this is continuously asking me to login. Can you help me on this? This is going into onConnectionFailed event only for signed apk (working for debug apk) image