Android proguard 规则给 twilio 客户端 sdk 带来错误

Android proguard rule gives error with twilio client sdk

我添加了具有以下混淆规则的 Twilio 客户端 SDK

 # Twilio Client
 -keep class com.twilio.** { *; }
 # Apache HttpClient
-dontwarn org.apache.http.**
-keepattributes InnerClasses

添加后,我收到以下一组错误消息

Warning:library class android.webkit.WebView depends on program class android.net.http.SslCertificate
Warning:library class android.webkit.WebViewClient depends on program class android.net.http.SslError
Warning:there were 3 instances of library classes depending on program classes.
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> java.io.IOException: Please correct the above warnings first.

为了抑制错误,我添加了这些规则集

-keep public class android.net.http.SslError
-keep public class android.webkit.WebViewClient

-dontwarn android.webkit.WebView
-dontwarn android.net.http.SslError
-dontwarn android.webkit.WebViewClient

当我执行上述操作时,出现了这些错误

Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(android.support.design.widget.o) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler

这会破坏 apk 构建。任何形式的帮助将不胜感激。 TIA

Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(android.support.design.widget.o) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler

要解决内部类问题,请将此添加到您的混淆文件中:

-keepattributes EnclosingMethod