7

I got the below message when I use newest version of com.google.android.gms:play-services-xxx:9.8.00

Error:(32, 28) error: cannot access zzanb class file for com.google.android.gms.internal.zzanb not found

The error was caused by invoking statement: FirebaseAuth.getInstance().getCurrentUser().getUid();

How can I fix this problem? Thank you.

UPDATE: Problem was solved

The newest updated of firebase version 9.8.0 is compatible with the google-service version 9.8.0. Now, everything works correctly.

NOTE: Firebase and Google Play Sevice always have same version. @see Ian Barber's comment below.

Robust
  • 2,415
  • 2
  • 22
  • 37
  • I know you've solved it by rolling back to the old one, but in case the issue exists when you upgrade again, can you confirm: Which version of Google Play services was on the device itself? Also, would you mind sharing your list of gradle dependencies? – Ian Barber Oct 24 '16 at 17:59
  • Additionally: are you using the Firebase Database in the code? If so, could you let us know how this call interacts with that? Part of our suspicion at the moment is a mismatch between the play-services and firebase version numbers. – Ian Barber Oct 24 '16 at 18:17
  • @IanBarber thank you for your response. I upgrade it again with the same Firebase version. Now, everything works correctly. But, I have a question "Is the Firebase version and google-service version always same?" – Robust Oct 25 '16 at 01:20
  • It is - Firebase is part of the Google Play services SDK, so they should always match – Ian Barber Oct 25 '16 at 16:11
  • @IanBarber Ok, thank you so much. – Robust Oct 25 '16 at 16:13
  • Just as a note as well - as Doug said below the 9.8.00 numbering was a bit of a mistake - if you update your Android SDK manager again you should be able to use "9.8.0", which is the more normal numbering. – Ian Barber Oct 25 '16 at 16:17
  • ok, wow, I just see 9.8.00 on firebase page this morning. Now it's 9.8.0. I'll try it tomorrow. So happy to get your support. Thank you :) – Robust Oct 25 '16 at 16:20

4 Answers4

8

9.8.0 was an accidental early release. Please don't use it! If you happened to update your Android tools over the weekend of October 22-23, you may have accidentally received this update. To remove it, simply uninstall and reinstall the Google Repository tool.

sud007
  • 5,824
  • 4
  • 56
  • 63
Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
  • Thank you for your response. I upgrade it again with the same Firebase version. Now, everything works correctly. – Robust Oct 25 '16 at 01:21
  • Good catch! I just rolled back the library versions to 9.6.1. Works fine! – sud007 Nov 02 '16 at 03:22
5

I had such a similar error when i was recently upgrading my play service dependency. It seems to occur when you leave out updating the firebase dependencies that correspond to the version of play services you use.

Here is what the two versions of my dependencies were:

Error version of dependencies

compile 'com.google.firebase:firebase-appindexing:10.0.1'
compile 'com.google.android.gms:play-services-maps:10.0.1'
compile 'com.google.android.gms:play-services-places:10.0.1'
compile 'com.google.android.gms:play-services-location:10.0.1'
compile 'com.google.firebase:firebase-auth:9.8.0'
compile 'com.google.firebase:firebase-database:9.8.0'
compile 'com.firebaseui:firebase-ui-database:1.0.1'
compile 'com.google.firebase:firebase-storage:9.8.0'

Working version of dependencies ``

compile 'com.google.firebase:firebase-appindexing:10.0.1'
compile 'com.google.android.gms:play-services-maps:10.0.1'
compile 'com.google.android.gms:play-services-places:10.0.1'
compile 'com.google.android.gms:play-services-location:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.0'
compile 'com.google.firebase:firebase-database:10.0.0'
compile 'com.firebaseui:firebase-ui-database:1.0.1'
compile 'com.google.firebase:firebase-storage:10.0.0'

`` Google seems to move play service updates along with firebase updates these days. Hopes this saves a few souls out there.

Akah
  • 1,389
  • 14
  • 19
3

There is a tricky inconsistency in the build.gradle(Module App) warnings that can lead to this error. I had all my play-services compiles:

compile 'com.google.android.gms:play-services-drive:9.6.1'
compile 'com.google.android.gms:play-services-plus:9.6.1'
--- etc ---

grayed out, with a note that a newer version, namely 9.8.0, was available after I upgraded various Google Play apks. After changing all the play-services compiles to 9.8.0:

compile 'com.google.android.gms:play-services-drive:9.8.0'
compile 'com.google.android.gms:play-services-plus:9.8.0' 
---etc---

I got the weird error:

class file for com.google.android.gms.internal.zzanb not found

in attempting to compile my code. The tricky thing was all my firebase compiles:

compile 'com.google.firebase:firebase-core:9.6.1'
compile 'com.google.firebase:firebase-invites:9.6.1'
---etc---

were NOT grayed out, so I neglected to upgrade those compiles at the same time as I upgraded the play-services compiles. Upgrading all the firebase compiles to 9.8.0:

compile 'com.google.firebase:firebase-core:9.8.0'
compile 'com.google.firebase:firebase-invites:9.8.0'
--- etc ---

fixed the error.

Also, the warnings in the monitor when you get this error suggest depressing 'deprecation' and 'unchecked' lint warnings. That is unnecessary and doesn't fix it.

Android Studio should gray out both the firebase and play-services compiles together to avoid this error, particularly as the error message is so cryptic and the lint warning suppression suggestions don't work.

Androidcoder
  • 4,389
  • 5
  • 35
  • 50
0

Finally, I get back to com.google.android.gms:play-services-xxx:9.6.1. I guest that the problem occur because of the difference between firebase version and gms version. Currently, Firebase run on version 9.6.1

Robust
  • 2,415
  • 2
  • 22
  • 37