Android Studio / Robolectric 测试随机失败

Android Studio / Robolectric tests fails randomly

我正在使用 Android Studio 3.3,并且我使用 Robolectric 3.3.2 进行了一些测试。

我有多个可能相关的问题。

我不知道它来自哪里。

    No such manifest file: build/intermediates/bundles/debug/AndroidManifest.xml

    java.lang.VerifyError: Expecting a stackmap frame at branch target 13
    Exception Details:
      Location:
        com/package/name/class.method(Ljava/util/List;Ljava/lang/String;I)Ljava/lang/String; @0: aload_0
      Reason:
        Expected stackmap frame at this location.
      Bytecode:
        0x0000000: 2a2b 1cb8 0038 2a2b 1cb8 0024 b04e 2dbf
        0x0000010: 4ebb 000d 5911 ea84 2db7 002b bf       
      Exception Handler Table:
        bci [0, 12] => handler: 13
        bci [0, 12] => handler: 16

我还尝试在 Java 6...

中添加我的依赖项和项目

行为真的很奇怪。它发生在所有从事该项目的人身上。解决方案(目前)是删除所有测试文件。

然后复制回来。

希望对其他人有所帮助。