在我将 minifyEnabled 设置为 true 后,应用程序因“java.lang.VerifyError:验证程序拒绝类 org.igniterealtime.jbosh.ApacheHTTPResponse”而崩溃

问题描述 投票:0回答:1

我将 JBOSH 与 Smack 一起使用,当我在将 minifyEnabled 设置为 true 后尝试调用

BoshClient.send(ComposableBody body)
时,它会抛出
java.lang.VerifyError
并且我的应用程序崩溃了。我可以添加一个 try catch 块来处理异常,但随后无法建立连接。我还在我的 proguard-rules.pro 文件中添加了 Bosh、Smack 和 Apache 库,它似乎没有任何区别。这是我的 proguard-rules.pro 文件:

-keep class org.igniterealtime.jbosh.ApacheHTTPResponse**
-keepclassmembernames class org.igniterealtime.jbosh.ApacheHTTPResponse** { *; }
-keep class org.igniterealtime.*,* { *; }
-keep class org.jivesoftware.*,* { *; }
-keep class org.xmlpull.*,* { *; }
-keep class org.apachecordovacamera.*,* { *; }
-keep class org.apache.*,* { *; }

这是崩溃的完整堆栈跟踪:

java.lang.VerifyError: Verifier rejected class org.igniterealtime.jbosh.ApacheHTTPResponse: void org.igniterealtime.jbosh.ApacheHTTPResponse.abort() failed to verify: void org.igniterealtime.jbosh.ApacheHTTPResponse.abort(): [0x4] 'this' argument 'Reference: org.apache.http.client.methods.HttpPost' not instance of 'Reference: org.apache.http.client.methods.AbstractExecutionAwareRequest' (declaration of 'org.igniterealtime.jbosh.ApacheHTTPResponse' appears in /data/app/~~C_a3PwWdaJDDDNDj2yDAfA==/com.myapp.stage-R1BpaF5cY9V7Xus_oIqsbQ==/base.apk!classes4.dex)
        at org.igniterealtime.jbosh.ApacheHTTPSender.send(SourceFile:122)
        at org.igniterealtime.jbosh.BOSHClient.send(SourceFile:539)
        at org.jivesoftware.smack.bosh.MyXMPPBOSHConnection.send(SourceFile:397)
        at org.jivesoftware.smack.bosh.MyXMPPBOSHConnection.sendElement(SourceFile:327)
        at org.jivesoftware.smack.bosh.MyXMPPBOSHConnection.send(SourceFile:317)
        at org.jivesoftware.smack.bosh.MyXMPPBOSHConnection.loginNonAnonymously(SourceFile:245)
        at org.jivesoftware.smack.AbstractXMPPConnection.login(SourceFile:456)
        at com.myapp.xmpp.XMPPConnectionManager.loginInternal(SourceFile:359)
        at com.myapp.xmpp.XMPPConnectionManager.connectAndAuthenticate(SourceFile:316)
        at com.myapp.xmpp.XMPPConnectionManager.xmppRequestStateChange(SourceFile:617)
        at com.myapp.xmpp.XMPPConnectionManager$1.run(SourceFile:103)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:246)
        at android.os.HandlerThread.run(HandlerThread.java:67)
android xmpp proguard
1个回答
0
投票

同样的问题!你找到解决办法了吗?

© www.soinside.com 2019 - 2024. All rights reserved.