【问题标题】:I've got an error when I added the truetime library in android在android中添加truetime库时出现错误
【发布时间】:2019-02-15 17:10:59
【问题描述】:

我已经添加了获取网络时间的 truetime 库,但是我遇到了一个错误,我无法在 android 中解决它。

图书馆:

implementation 'com.github.instacart.truetime-android:library-extension-rx:2.0'

错误: Android 问题:

    InnerClass annotations are missing corresponding EnclosingMember annotations. Such InnerClass annotations are ignored.
Message{kind=WARNING, text=InnerClass annotations are missing corresponding EnclosingMember annotations. Such InnerClass annotations are ignored., sources=[Unknown source file], tool name=Optional.of(D8)}

Java 编译器:

The rule `-keep public class *extends java.lang.annotation.Annotation { 

我尝试了很多,但无法解决。

请任何人解决这个问题。将不胜感激。

提前致谢。

【问题讨论】:

  • 你试过Invalidate caches> Restart文件吗?
  • 我试过了,但没有成功。

标签: android android-gradle-plugin build.gradle proguard android-proguard


【解决方案1】:

请查看答案here

为了您的方便,我也在这里提供答案:

解决方案 1:

尝试将您的 gradle 更新到最新版本。

解决方案 2:

在proguard规则上添加这行代码

-keepattributes *Annotation*
-keep @**annotation** class * {*;}

【讨论】:

  • @AnubhavGupta 抱歉,我忘了放链接以供参考。
  • @AnubhavGupta 我做了所有事情仍然遇到同样的错误
  • 你在 gradle 中启用 multiDex 为 true 了吗?
  • 是的,我启用了,即使我更新了我的 gradle 仍然出现同样的错误
猜你喜欢
  • 1970-01-01
  • 2014-05-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-07-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多