Android问题汇总(遥远的回忆过去)

com.alipay.android.phone.mrpc.co

2019-08-07  本文已影响0人  MonkeyLei

之前我们混淆文章有介绍过简单快速的处理方法 AS混淆打包错误(java compiler)第一篇:can't find reference method/field - okhttp3/第三方库等

下面记录下,把国外的帖子拔过来就行,应该能看懂嗮...:

For those looking for the quick fix, the solution is to add the following line to your ProGuard configuation file:

-dontwarn android.net.SSLCertificateSocketFactory

1 - Apache Library

Android-M removes support for the Apache HTTP library. As mentioned in the question, the fix is to use the legacy support JAR by updating your build.gradle. Here is the code with a bit more context:

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    useLibrary 'org.apache.http.legacy'
    ....
}

2 - Update ProGuard Configuration

The actual error comes from ProGuard, when it is trying to process Parse.com.

Warning: com.parse.ParseApacheHttpClient: 
can't find referenced method 'org.apache.http.conn.ssl.SSLSocketFactory getHttpSocketFactory(int,android.net.SSLSessionCache)' 
in library class android.net.SSLCertificateSocketFactory

Parse is now open source, so checking the issues gives this page on GitHub:

The discussion explains that this is just a ProGuard config item, and can be safely fixed by updating your config as per the related issue:

Here is the change (line 3 fixes our issue, line 4 fixes related issue):

-keepattributes *Annotation*
-keepattributes Signature
-dontwarn android.net.SSLCertificateSocketFactory
-dontwarn android.app.Notification
-dontwarn com.squareup.**
-dontwarn okio.**

As explained in <u style="text-decoration: none; border-bottom: 1px dashed grey;">this comment</u>, it is safe to ignore the warnings since those classes are only ever used on Android versions that still contain the mentioned classes.

上一篇下一篇

猜你喜欢

热点阅读