Build Failed With Error Cannot Access Hide

Viewed 2680

I suddenly started getting below error when I restarted Android.

I tried Clean Build, Rebuild, Invalidate Cache etc. but nothing worked. Also followed some inputs given on various sites to know real issue. I run the compiler with --scan and got below details of problem.

error: cannot access Hide
  class file for com.google.android.gms.common.internal.Hide not found
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
:app:compileDebugJavaWithJavac FAILED
:app:buildInfoGeneratorDebug

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Pls guide how to fix this now. What went wrong all of sudden.

3 Answers

Finally got the issue calling this Class.

it was update of implementation 'com.google.android.gms:play-services-ads:15.0.0' to 17.0.0

One thing I learnt with this issue , never multiple update library together as which started creating issue will be a challenge to find later. Update one at a time , build apk and then try with other update.

I was able to solve this by updating my google and firebase libraries.

So if you're getting this error, look to update your google gms libraries and firebase libraries in build.gradle.

Below are the ones I had that I updated to the following versions on July 2019:

com.google.firebase:firebase-auth 18.1.0
com.google.firebase:firebase-core 17.0.1
com.google.firebase:firebase-messaging 19.0.0
com.google.firebase:firebase-storage 18.1.0
com.google.android.gms:play-services-auth 18.1.0

Your firebase libraries are incompatible with each other.

Please refer to the official documentation to add your libraries.

Meanwhile i was able to solve my problem using the below libraries version.

implementation 'com.google.firebase:firebase-auth:19.2.0'
implementation 'com.google.firebase:firebase-analytics:17.2.2'
implementation 'com.google.firebase:firebase-messaging:20.1.0'
implementation 'com.google.firebase:firebase-storage:19.1.1'
implementation 'com.google.firebase:firebase-firestore:21.4.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.firebaseui:firebase-ui-firestore:6.2.0'
Related