Java.lang.VerifyError: 验证器拒绝类。在调试模式下代码正常工作,但在发布模式下不会抛出此错误。

8

请帮忙解决这个错误。以下是错误日志:

Caused by: java.lang.VerifyError: Verifier rejected class edu.mit.jwi.morph.SimpleStemmer: java.util.List edu.mit.jwi.morph.SimpleStemmer.getNounCollocationRoots(java.lang.String) failed to verify: java.util.List edu.mit.jwi.morph.SimpleStemmer.getNounCollocationRoots(java.lang.String): [0x50] register v6 has type Reference: java.lang.Object but expected Precise Reference: java.lang.String

     java.util.List edu.mit.jwi.morph.SimpleStemmer.getVerbCollocationRoots(java.lang.String) failed to verify: java.util.List edu.mit.jwi.morph.SimpleStemmer.getVerbCollocationRoots(java.lang.String): [0x60] register v7 has type Reference: java.lang.Object but expected Precise Reference: java.lang.String

1
请发布一些代码,并告诉我们哪部分代码导致了这个错误。 - Reaz Murshed
4个回答

6

遇到同样的问题,我正在使用

implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9'

我把协程降级了。
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.6'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.6'

它起作用了。

根据Kotlin文档,版本1.3.9存在一些bug。


3

降级依赖项对我无效。

移除@JvmStatic

如果您创建了一个挂起函数,请确保您没有为此方法使用@JvmStatic注解。 这样做肯定会引发此错误。


3

1

问题已解决。这是在使用Proguard后出现的不必要的问题。

在Proguard规则中为该类添加-dontwarn。发布版本完全正常运行。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接