【问题标题】:java.lang.RuntimeException: stub only when proguard enabled truejava.lang.RuntimeException:仅当 proguard 启用时存根为 true
【发布时间】:2020-10-13 08:56:18
【问题描述】:

我编写了一个示例应用程序,我在其中从本地主机获取数据... 一年前创建了这个应用程序,最后我上周使用或最多两周前使用,并且应用程序运行良好,一切都如符合我的预期

更新

Resolved this issue by disabling proguard, but I want to enable like, I've enabled earlier

突然,app 已经停止从 localhost 获取数据,看不到更多,但这是我在 Log 中找到的:

2020-06-23 15:25:51.666 3751-3751/? W/RefBase: CallStack::getCurrentInternal not linked, returning null
2020-06-23 15:25:51.666 3751-3751/? W/RefBase: CallStack::logStackInternal not linked
2020-06-23 15:25:51.687 27221-27221/? W/ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1631 android.content.ContextWrapper.startService:683 android.content.ContextWrapper.startService:683 com.sec.android.diagmonagent.sa.receiver.CFLogReceiver.sendCFLog:21 com.sec.android.diagmonagent.sa.receiver.CFLogReceiver.onReceive:13 
2020-06-23 15:25:51.705 19718-19718/com.example.myapp W/System.err: java.lang.RuntimeException: stub
2020-06-23 15:25:51.705 19718-19718/com.example.myapp W/System.err:     at c.e.b.a.<init>(:36)
2020-06-23 15:25:51.705 19718-19718/com.example.myapp W/System.err:     at com.example.myapp.UserInfoActivity$e.<init>(:362)
2020-06-23 15:25:51.705 19718-19718/com.example.myapp W/System.err:     at com.example.myapp.UserInfoActivity.onCreate(:49)
2020-06-23 15:25:51.705 19718-19718/com.example.myapp W/System.err:     at android.app.Activity.performCreate(Activity.java:7955)
2020-06-23 15:25:51.705 19718-19718/com.example.myapp W/System.err:     at android.app.Activity.performCreate(Activity.java:7944)
2020-06-23 15:25:51.705 19718-19718/com.example.myapp W/System.err:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
2020-06-23 15:25:51.705 19718-19718/com.example.myapp W/System.err:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3423)
2020-06-23 15:25:51.706 19718-19718/com.example.myapp W/System.err:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3595)
2020-06-23 15:25:51.706 19718-19718/com.example.myapp W/System.err:     at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
2020-06-23 15:25:51.706 19718-19718/com.example.myapp W/System.err:     at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
2020-06-23 15:25:51.706 19718-19718/com.example.myapp W/System.err:     at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
2020-06-23 15:25:51.706 19718-19718/com.example.myapp W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2147)
2020-06-23 15:25:51.706 19718-19718/com.example.myapp W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:107)
2020-06-23 15:25:51.706 19718-19718/com.example.myapp W/System.err:     at android.os.Looper.loop(Looper.java:237)
2020-06-23 15:25:51.706 19718-19718/com.example.myapp W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:7807)
2020-06-23 15:25:51.706 19718-19718/com.example.myapp W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
2020-06-23 15:25:51.706 19718-19718/com.example.myapp W/System.err:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
2020-06-23 15:25:51.706 19718-19718/com.example.myapp W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1047)

【问题讨论】:

  • 如果您可以共享您的代码以便我们可以看到实际导致错误的原因,那么调试会更容易。但是,这可能与您有关stackoverflow.com/questions/16013787/…。
  • 也许这会有所帮助:stackoverflow.com/questions/30538640/…。您的 ContextImpl: Calling a method in the system process without a qualified user 只是警告,您可以忽略它。这是真正的问题:java.lang.RuntimeException: stub。我与您分享的主题是第二个例外:javax.net.ssl.SSLException: Read error: ssl=0x6fb34f6008: I/O error during system call, Connection reset by peer。希望这会有所帮助。
  • 是的,我知道。但我不知道解决方案
  • 没有看到 UserInfoActivity 的代码是不可能的。

标签: android proguard stub


【解决方案1】:

所以基本上,你的类和字段在混淆过程中被重命名,因此导致了这个错误。解决这个问题的最简单方法是在 pro 保护规则文件中添加您不希望混淆的类的完整类名。参考:ProGuard - Obfuscating apk causing error

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-05
    • 2014-05-18
    • 2012-10-11
    • 1970-01-01
    • 1970-01-01
    • 2017-05-24
    相关资源
    最近更新 更多