我的android项目编译和构建很好,但是,当我添加NanoHTTPD java文件(纯java 1文件http服务器)时,我在启动时遇到以下错误(没有proguard)。
[2013-03-20 23:28:56 - test] Dx
EXCEPTION FROM SIMULATION:
[2013-03-20 23:28:56 - test] Dx local variable type mismatch: attempt to set or access a value of type int using a local variable of type java.io.ByteArrayInputStream. This is symptomatic of .class transformation tools that ignore local variable information.
[2013-03-20 23:28:56 - test] Dx ...at bytecode offset 0000009d
locals[0000]: Lcom/my/android/test/NanoHTTPD$HTTPSession;
locals[0001]: Ljava/io/InputStream;
locals[0002]: I
locals[0003]: [B
locals[0004]: I
locals[0005]: I
locals[0006]: I
locals[0007]:
locals[0008]:
locals[0009]:
locals[000a]:
locals[000b]:
locals[000c]:
locals[000d]:
locals[000e]:
locals[000f]:
locals[0010]:
locals[0011]:
locals[0012]:
locals[0013]:
locals[0014]:
locals[0015]:
locals[0016]:
locals[0017]:
locals[0018]:
locals[0019]:
locals[001a]:
locals[001b]: [I
...while working on block 009d
...while working on method run:()V
...while processing run ()V
...while processing com/my/android/test/NanoHTTPD$HTTPSession.class
[2013-03-20 23:28:56 - test] Dx
EXCEPTION FROM SIMULATION:
[2013-03-20 23:28:56 - test] Dx local variable type mismatch: attempt to set or access a value of type java.lang.Object using a local variable of type int. This is symptomatic of .class transformation tools that ignore local variable information.
[2013-03-20 23:28:56 - test] Dx ...at bytecode offset 000002cd
locals[0000]: Lcom/my/android/test/NanoHTTPD;
locals[0001]: Ljava/lang/String;
locals[0002]: Ljava/util/Properties;
locals[0003]: Ljava/io/File;
locals[0004]: I
locals[0005]: Lcom/my/android/test/NanoHTTPD$Response;
locals[0006]: Ljava/io/File;
locals[0007]: [Ljava/lang/String;
locals[0008]: Ljava/lang/String;
locals[0009]:
locals[000a]:
locals[000b]:
locals[000c]:
locals[000d]:
locals[000e]:
locals[000f]:
locals[0010]:
locals[0011]:
locals[0012]:
locals[0013]:
locals[0014]:
locals[0015]:
locals[0016]: [I
stack[top0]: Ljava/lang/String;
...while working on block 02cd
...while working on method serveFile:(Ljava/lang/String;Ljava/util/Properties;Ljava/io/File;Z)Lcom/my/android/test/NanoHTTPD$Response;
...while processing serveFile (Ljava/lang/String;Ljava/util/Properties;Ljava/io/File;Z)Lcom/my/android/test/NanoHTTPD$Response;
...while processing com/my/android/test/NanoHTTPD.class
这只发生在当前项目中,当我在其他项目中使用NanoHTTPD时没有发生。
我该如何解决?
答案 0 :(得分:2)
原来它是一个eclipse插件,它做到了 - CodePro BY GOOGLE! 他们的代码覆盖工具以某种方式导致上述错误(可能与emma有关,但这只是猜测)。