添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

java.lang.VerifyError: Verifier rejected class. Code working fine in debug mode, but not throwing this error in release mode

Ask Question

Please help on this error.Below is error logcat:

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

Faced the same issue, I was using

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

I degraded the corountine to

implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.6'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.6'

and it worked.

It seems version 1.3.9 has some bugs according to kotlin documentation

If it happend to coroutines on Android, revert coroutines lib to 1.3.6 works for me. It seems that there is VerifyError bug in android coroutines lib version 1.3.7-1.3.8, and fixed after 1.4.0.

Details see below link: https://github.com/Kotlin/kotlinx.coroutines/issues/2049 https://github.com/Kotlin/kotlinx.coroutines/issues/2041

Downgrading dependencies did not work for me.

Remove @JvmStatic

If you create a suspend function be sure that you are not also using the @JvmStatic annotation for this method. Doing so will definitely throw this error.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.