How to set -noverify option with gradle ktx for android robolectric tests?

529 Views Asked by At

I am using Roboelectric for unit testing an android app, and bumped into an error while trying to write to SecureStorage - java.lang.VerifyError: Expecting a stackmap frame at branch target 10

I don't need verification enabled for unit tests, so would want to disable it, but using gradle ktx and don't know the right way to set jvm flags there for the unit testing task.

Thing I tried and doesn't work:

tasks.withType<Test> {
    jvmArgs?.add("-noverify")
}

1

There are 1 best solutions below

1
On BEST ANSWER

Try settting it in edit configuration. -ea will be there. Replace it with -ea -noverify.