生成失败并出现错误,无法访问隐藏

时间:2018-11-03 14:36:30

标签: java android

重新启动Android时,我突然开始出现错误。

我尝试了“清理构建”,“重建”,“使缓存无效”等,但没有任何效果。还遵循了在各个站点上提供的一些信息,以了解实际问题。我使用--scan运行编译器,并获得以下问题的详细信息。

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

请指导如何立即解决此问题。突然出了什么问题。

3 个答案:

答案 0 :(得分:1)

最后遇到了调用此类的问题。

这是将实现com.google.android.gms:play-services-ads:15.0.0'更新为17.0.0

我从这个问题中学到的一件事,永远不会有多个更新库一起开始创建问题,这将是以后发现的挑战。一次更新一个,构建apk,然后尝试其他更新。

答案 1 :(得分:0)

我能够通过更新Google和Firebase库来解决此问题。

因此,如果遇到此错误,请查看build.gradle中的Google gms库和firebase库。

下面是我在2019年7月更新到以下版本的版本:

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

答案 2 :(得分:0)

您的Firebase库彼此不兼容。

请参考official documentation添加您的库。

与此同时,我可以使用以下库版本解决问题。

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'