搜尋

首頁  >  問答  >  主體

gradle - 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

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

高洛峰高洛峰2772 天前580

全部回覆(1)我來回復

  • 伊谢尔伦

    伊谢尔伦2017-04-17 17:10:13

    你可能用到了什麼函式庫,或是某程式碼包含了一些高版不支援的語法,或是庫中的字節碼有什麼特殊的高版本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.

    回覆
    0
  • 取消回覆