gpt4 book ai didi

android - java.lang.VerifyError : Verifier rejected class: Constructor returning without calling superclass constructor 错误

转载 作者:行者123 更新时间:2023-11-30 05:10:27 24 4
gpt4 key购买 nike

当我使用 proguard 构建发布版本时,我在应用程序启动时遇到运行时错误(回溯):

2018-12-18 23:10:37.787 16077-16077/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.cantalk.ruen.dialogs, PID: 16077
java.lang.VerifyError: Verifier rejected class age: void com.google.android.gms.common.wrappers.Wrappers.<init>() failed to verify: void com.google.android.gms.common.wrappers.Wrappers.<init>(): [0x1] Constructor returning without calling superclass constructor (declaration of 'com.google.android.gms.common.wrappers.Wrappers' appears in base.apk)
at com.google.android.gms.common.wrappers.Wrappers.packageManager(Unknown Source:0)
at com.google.android.gms.internal.ads.zzze.zzh(Unknown Source:0)
at com.google.android.gms.internal.ads.zzze.attachInfo(Unknown Source:0)
at com.google.android.gms.ads.MobileAdsInitProvider.attachInfo(Unknown Source:2)
at android.app.ActivityThread.installProvider(ActivityThread.java:6391)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5938)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5853)
at android.app.ActivityThread.access$1100(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

我认为它是由 admob 初始化引起的,但我不知道它以前为什么起作用。依赖更新后出现此错误:

enter image description here enter image description here

最佳答案

在我的例子中,我在混淆规则中使用了assumenosideeffects。像这样:

-assumenosideeffects class java.io.PrintStream { *; }  

这导致 proguard 中的错误从每个类的构造函数中删除父类(super class)构造函数调用。要解决此问题,您必须将其更改为:

-assumenosideeffects class java.io.PrintStream { 
*** <fields>;
*** <methods>;
}

PrintStream 是您要使用混淆器混淆的类。这解决了我的问题。

关于android - java.lang.VerifyError : Verifier rejected class: Constructor returning without calling superclass constructor 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53840991/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com