在我的android项目中,我打开了前哨,收到了下面的警告。在谷歌上搜索,但找不到多少信息。
org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement :找不到引用的类Warning:retrofit.Platform$Java8
我已经在我的项目中加入了retrofit2保护规则。
-dontwarn retrofit2.**
-keep class retrofit2.** { *; }
-keepattributes Signature
-keepattributes Exceptions
-keepclasseswithmembers class * {
@retrofit2.http.* <methods>;
}发布于 2017-05-26 08:36:19
对Retroeft2.3.0和okHTP3.8.0使用以下保护规则
-dontnote retrofit2.Platform
-dontwarn retrofit2.Platform$Java8adapters.
-keepattributes Signature
-keepattributes Exceptions
-dontwarn org.xmlpull.v1.**
-dontwarn okhttp3.**
-dontwarn okio.**
-dontwarn javax.annotation.**发布于 2017-05-26 08:33:17
像这样改变它:
-dontwarn okio.**
-dontwarn retrofit2.Platform$Java8在Java 8 VM上运行时,Retrofit页面已经注意到了这个过程保护构建:
为什么会发生这种事?
原因是:编译器试图引用Java 8类,当您不通过Proguard引用Java 8类时,在明确提到它之后,Java 8类就不会被使用了。例如,Java 8的java.nio.*包在Android上不可用,永远不会被调用。
https://stackoverflow.com/questions/44197001
复制相似问题