Gradle: Bad <init> method call from inside of a branch (invokespecial)

末鹿安然 提交于 2019-12-05 03:02:57

The most obvious way to deal with VerifyError is to use -noverify jvm option.

(Assuming gradle version >=1.12, and gradle wrapper as executable bin)

First of all, tell gradle to use the option for the compilation process (in your build.gradle):

compileGroovy {
    groovyOptions.forkOptions.jvmArgs = ['-noverify']
}

For runtime, you should pass jvm option also:

Test task:

test {
    jvmArgs '-noverify'
}

If you use application plugin:

applicationDefaultJvmArgs = ["-noverify"]

Or, by any other means.

That'll be all. Happy waiting for java release with fix:

This is a jdk bug & it has been fixed in latest jdk version 7 u72

Boaz Nahum

It happens when Constructor calls super.

Adding @CompileStatic on Constructor solves the problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!