2

我的 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 时没有发生。

我该如何解决?

4

1 回答 1

2

原来是一个 Eclipse 插件做到了 - CodePro BY GOOGLE!他们的代码覆盖工具不知何故导致了上述错误(可能与 emma 有关,但这只是猜测)。

于 2013-03-26T21:15:48.503 回答