I am creating a Google Drive Integration in my existing app.
I have followed Google Drive Integration instructions.
I have created Oauth 2.0 client key for android using sha1 and package name.
I am just using code from below link for testing purpose but I can't make it run.
But each time I try upload file I am getting below exception.
02-25 18:18:40.703: W/GLSActivity(1853): [anc] Status from wire: INVALID_KEY status: null
02-25 18:18:40.703: W/GLSActivity(1853): [anc] Status from wire: INVALID_KEY status: null
02-25 18:18:40.703: I/GLSUser(1853): GLS error: INVALID_KEY skypatel7@gmail.com oauth2:https://www.googleapis.com/auth/drive
02-25 18:18:40.710: W/GLSActivity(1853): [anc] Status from wire: Unknown status: UNKNOWN
02-25 18:18:40.710: W/System.err(24843): com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAuthIOException
02-25 18:18:40.718: W/System.err(24843): at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential$RequestHandler.intercept(GoogleAccountCredential.java:224)
02-25 18:18:40.718: W/System.err(24843): at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:859)
02-25 18:18:40.718: W/System.err(24843): at com.google.api.client.googleapis.media.MediaHttpUploader.executeUploadInitiation(MediaHttpUploader.java:352)
02-25 18:18:40.718: W/System.err(24843): at com.google.api.client.googleapis.media.MediaHttpUploader.upload(MediaHttpUploader.java:266)
02-25 18:18:40.718: W/System.err(24843): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:408)
02-25 18:18:40.718: W/System.err(24843): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:328)
02-25 18:18:40.718: W/System.err(24843): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:449)
02-25 18:18:40.718: W/System.err(24843): at com.skyproductivity.android.trackerdrive.MainActivity$1.run(MainActivity.java:116)
02-25 18:18:40.718: W/System.err(24843): at java.lang.Thread.run(Thread.java:1019)
02-25 18:18:40.718: W/System.err(24843): Caused by: com.google.android.gms.auth.GoogleAuthException: Unknown
02-25 18:18:40.726: W/System.err(24843): at com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source)
02-25 18:18:40.726: W/System.err(24843): at com.google.android.gms.Auth. GoogleAuthUtil.getToken(Unknown Source)
02-25 18:18:40.726: W/System.err(24843): at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential.getToken(GoogleAccountCredential.java:192)
02-25 18:18:40.726: W/System.err(24843): at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential$RequestHandler.intercept(GoogleAccountCredential.java:217)
02-25 18:18:40.726: W/System.err(24843): ... 8 more
`
I have already spent more then 50 Hr searching this very error.
Finally i drop idea of using google google drive api using google pay service.
I use java Api client for google drive.
In this method you need to use webview for authentication. refere below tutorial.
http://www.learn2crack.com/2014/01/android-google-oauth2.html