首页 > Android APP 编译出错了java.lang.VerifyError 求解决方案???

Android APP 编译出错了java.lang.VerifyError 求解决方案???

编译出错了
终端和AS编译都有问题

编译错误信息如下:

Error:Execution failed for task ':app:compileReleaseJavaWithJavac'.
> java.lang.VerifyError: Expecting a stackmap frame at branch target 23
  Exception Details:
    Location:
      com/example/Eventbus/annotation/ThreadMode.<init>(Ljava/lang/String;I)V @12: ifeq
    Reason:
      Expected stackmap frame at this location.
    Bytecode:
      0000000: 2a2b 1cb7 0006 b200 3db6 0041 9900 0bb2
      0000010: 0047 1249 b600 4fb1   

具体开发环境详细信息
Mac OX 10.10.5
Android Studio 2.0
Android SDK 23.0.2
Gradle 2.10
JDK 1.8_77
Maven 3.2.3
Groovy 2.4.6

各位大虾们有遇到这个问题么???在线等....


你可能用到了什么库,或者某代码中包含了一些高版本不支持的语法,或者库中的字节码有什么特殊的高版本jdk不兼容的情况。
这个问题之前我也遇到过,当时是因为擅自修改了jar包中的字节码文件却修改错了所致。
下面是stackoverflow上看到的回复,可做参考:

Java 7 introduced a stricter verification and changed the class format a bit -- to contain a stack map, used to verify that code is correct. The exception you see, means that some method doesn't have a valid stack map.

Java version or bytecode instrumentation could both be to blame. Usually this means that a library that the application uses, generates invalid bytecode that doesn't pass the stricter verification. So nothing else than reporting it as a bug to the library can be done by the developer.

As a workaround you can add -noverify to the JVM arguments in order to disable verification. In Java 7 it was also possible to use -XX:-UseSplitVerifier to use the less strict verification method, but that option was removed in Java 8.
【热门文章】
【热门文章】