首页 > 解决方案 > 在android中添加truetime库时出现错误

问题描述

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

图书馆:

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

错误:安卓问题:

    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 { 

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

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

提前致谢。

标签: androidandroid-gradle-pluginbuild.gradleproguardandroid-proguard

解决方案


请在此处查看答案。

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

解决方案1:

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

解决方案2:

在 proguard 规则上添加这行代码

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

推荐阅读