gpt4 book ai didi

android - 将 'emma' 添加到 Android ant build 触发 "local variable type mismatch"异常

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:06:15 26 4
gpt4 key购买 nike

我正在尝试在 Android 项目的测试中运行 Emma,该项目是 Java 和 C/JNI 代码的组合。构建和测试工作正常,但每当我添加 emma 时,我都会遇到一个神秘的异常。我使用的是 Android SDK v20.1 和 NDK r8b。

项目在这里,它是一个Android库项目: https://github.com/guardianproject/IOCipher测试在这里: https://github.com/guardianproject/IOCipherTests

build.xml 文件是使用android update test-project 生成的。运行 ant clean debug install test 每次都有效,而 ant clean emma debug install test 触发异常:

异常(exception)情况:

-dex:
[dex] Converting compiled files and external libraries into /var/lib/jenkins/workspace/IOCipherTests/IOCipherTests/bin/classes.dex...
[dx]
[dx] EXCEPTION FROM SIMULATION:
[dx] local variable type mismatch: attempt to set or access a value of type int using a local variable of type info.guardianproject.libcore.io.ErrnoException. This is symptomatic of .class transformation tools that ignore local variable information.
[dx]
[dx] ...at bytecode offset 0000002e
[dx] locals[0000]: Linfo/guardianproject/iocipher/File;
[dx] locals[0001]: Linfo/guardianproject/iocipher/FileDescriptor;
[dx] locals[0002]: <invalid>
[dx] locals[0003]: <invalid>
[dx] locals[0004]: <invalid>
[dx] locals[0005]: [Z
[dx] stack[top0]: int{0x00000001 / 1}
[dx] ...while working on block 002c
[dx] ...while working on method createNewFile:()Z
[dx] ...while processing createNewFile ()Z
[dx] ...while processing info/guardianproject/iocipher/File.class
[dx]
[dx] 1 error; aborting
BUILD FAILED
/opt/android-sdk/tools/ant/build.xml:850: The following error occurred while executing this line:
/opt/android-sdk/tools/ant/build.xml:852: The following error occurred while executing this line:
/opt/android-sdk/tools/ant/build.xml:864: The following error occurred while executing this line:
/opt/android-sdk/tools/ant/build.xml:266: null returned: 1

最佳答案

我遇到了同样的错误。在我的项目中,我们在一个项目中有一个单元测试应用程序,它包装了另一个包含单元测试本身的项目。这两个项目都引用了我的 SDK,正如 chaitanya 所建议的那样,这导致 emma 两次检测 SDK 代码。通过删除单元测试项目中对 SDK 的引用,我能够解决错误。

关于android - 将 'emma' 添加到 Android ant build 触发 "local variable type mismatch"异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12203826/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com