Android版的ClassNotFoundException的HttpComponents [英] Android ClassNotFoundException for HttpComponents
问题描述
我在一个奇怪的情况,我不知道发生了什么事情。
I am in a weird situation, which I have no idea what's going on.
在code的工作,直到我升级我的Android SDK为R17。
The code was working, until I upgraded my Android SDK to r17.
在code是能够编译,但在运行时, Eclipse中抛出了ClassNotFoundException()
下的findClass方法,PathClassLoader.class
The code is able to compile, but during runtime, Eclipse throws ClassNotFoundException()
, under findClass method, in PathClassLoader.class
这是未找到类是org.apache.http.entity.mime.content.ContentBody和org.apache.http.entity.mime.content.StringBody
我已导入最新的(4.1.3)的HTTP组件jar文件到项目 - >属性 - > Java构建path->添加外部JAR
和也很清楚我的项目N次,但似乎没有任何工作。
and also clear my project N-times, yet nothing seems work.
这是从logcat的:
This is from the logcat:
03-27 17:31:32.461: W/dalvikvm(14263): VFY: unable to find class referenced in signature (Lorg/apache/http/entity/mime/content/ContentBody;)
03-27 17:31:33.802: E/dalvikvm(14263): Could not find class 'org.apache.http.entity.mime.content.StringBody', referenced from method com.milotin.core.base.MTBaseNetworkUtilities.getContentBody
03-27 17:31:33.802: W/dalvikvm(14263): VFY: unable to resolve new-instance 710 (Lorg/apache/http/entity/mime/content/StringBody;) in Lcom/milotin/core/base/MTBaseNetworkUtilities;
(抱歉凌乱贴,实际上是从logcat中仅有3行)
(sorry for the messy paste, is actually just 3 lines from logcat)
我TargetSDK为API10,而MinSDK是API8。
My TargetSDK is API10, and MinSDK is API8.
这是什么原因?
推荐答案
是的! R17是罪魁祸首!我习惯把这些.jar文件我的项目之外,现在我把他们变成我的项目/ lib文件夹,以及问题解决了。这里就是我得到了我的解决方案: JAR-文件的问题与ADT R17
Yes!! r17 is the culprit!! I used to put those .jar files outside my project, now I moved them into my project/lib folder, and problem solved. Here is where I got my solution: Jar-file issue with ADT r17
谢谢!
这篇关于Android版的ClassNotFoundException的HttpComponents的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!