Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GoogleAuthUtil.getToken SecurityException

I was getting this failure on a ICS device with latest Google Play Services when trying to call GoogleAuthUtil.getToken(args). The issue was resolved by removing and adding Google account to the phone. I wasn't able to reproduce the error. Google searching stack trace provided no insights. Any ideas on how this issue could be prevented and what it means are appreciated!

W/System.err( 3145): java.lang.SecurityException: Permission Denial: reading com.google.android.gsf.gservices.GservicesProvider uri content://com.google.android.gsf.gservices/prefix from pid=3145, uid=10055 requires com.google.android.providers.gsf.permission.READ_GSERVICES
W/System.err( 3145):    at android.os.Parcel.readException(Parcel.java:1327)
W/System.err( 3145):    at android.os.Parcel.readException(Parcel.java:1281)
W/System.err( 3145):    at com.google.android.gms.internal.a$a$a.a(Unknown Source)
W/System.err( 3145):    at com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source)
W/System.err( 3145):    at com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source)
W/System.err( 3145):    at com.xxxxx.Backend.obtainSheetKeyAndInitService(Backend.java:112)
W/System.err( 3145):    at com.xxxxx.Backend.fetchColumns(Backend.java:103)
W/System.err( 3145):    at com.xxxxx.ProgressActivity$DummySectionFragment$3.doInBackground(ProgressActivity.java:288)
W/System.err( 3145):    at com.xxxxx.ProgressActivity$DummySectionFragment$3.doInBackground(ProgressActivity.java:1)
W/System.err( 3145):    at android.os.AsyncTask$2.call(AsyncTask.java:264)
W/System.err( 3145):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
W/System.err( 3145):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
W/System.err( 3145):    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)
W/System.err( 3145):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
W/System.err( 3145):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
W/System.err( 3145):    at java.lang.Thread.run(Thread.java:856)

EDIT

As of time of reporting the bug:

  • google_play_services-lib android:versionName="3.2.65 (834000-30)"
  • Google Play Services version on device 4.0.31

Updated library to 4.0.30 and added requested permission to Manifest which seems to have worked. Waiting for Google to confirm that new library version fixes this issue because adding a new permission is a highly undesirable fix.

Bug report: http://code.google.com/p/android/issues/detail?id=61934

like image 742
zavidovych Avatar asked Nov 06 '13 15:11

zavidovych


2 Answers

You should add

<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />

to the AndroidManifest.xml file. Thats all.

like image 184
tasomaniac Avatar answered Sep 30 '22 13:09

tasomaniac


Today 2013-11-14 there has been a large drop in the number of error reports we have received due to this exception. Also I see Google Play Services version 4.0.33 is out, I didn't notice exactly when that released but it looks like yesterday.

Perhaps Google released a fix in 4.0.33? That would be great!

If anyone has been able to reproduce this bug, please let us know if 4.0.33 fixes it for you. (We have never been able to reproduce the bug on a dev device, although we have have zillions of traces from our installed base.)

[UPDATE] Google has definitely pushed a fix, we had only a handful of reports on 11/15 and zero on 11/16

like image 24
mwk Avatar answered Sep 30 '22 13:09

mwk