我为我的 Android 项目运行 ProGuard,得到以下警告:
Note: duplicate definition of library class [org.apache.http.conn.scheme.HostNameResolver]
Note: duplicate definition of library class [org.apache.http.conn.scheme.SocketFactory]
Note: duplicate definition of library class [org.apache.http.conn.ConnectTimeoutException]
Note: duplicate definition of library class [org.apache.http.params.HttpParams]
Note: duplicate definition of library class [android.net.http.SslCertificate$DName]
Note: duplicate definition of library class [android.net.http.SslError]
Note: duplicate definition of library class [android.net.http.SslCertificate]
Note: there were 7 duplicate class definitions.
我发现 给你可以通过忽略它来解决这个问题:
-keep class org.apache.http.** { *; }
-dontwarn org.apache.http.**
-keep class android.net.http.** { *; }
-dontwarn android.net.http.**
我没有看到从使用的库中删除副本的方法。即使在使用 dontwarn
之后,警告也不会消失。
忽略这个警告是正确的处理方式吗? 还是这会导致问题