Apache的类定义未找到 [英] Apache Class Definition not found

查看:151
本文介绍了Apache的类定义未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用code以下行

    ByteArrayBody bab = new ByteArrayBody(data, "/mnt/sdcard/p270.jpg");

这是扔以下豁免

    05-30 18:28:17.128: E/AndroidRuntime(5549): java.lang.NoClassDefFoundError: org.apache.http.entity.mime.content.ByteArrayBody

我已引用HTTP-MIME-4.1.2.jar(今天再次删除它和下载)。我也有清洗项目和重建。我还是继续得到同样的错误。

I have referenced http-mime-4.1.2.jar ( deleted it and downloaded again today). I have also cleaned the project and rebuild it. I still keep getting the same error.

我使用的Andr​​oid 4.04和Eclipse。

I am using Android 4.04 and Eclipse.

有什么建议?

推荐答案

罐子(S)复制到该项目的libs目录。不要重命名lib文件夹。刚刚关闭Eclipse,创建项目的主文件夹下新建文件夹库,在库目录,打开Eclipse复制的罐子,使用右键点击libs文件夹(这个时间内蚀),然后选择刷新,并让您的罐子就会出现。
然后运行该项目。在我的情况下它的工作。

Copy the jar(s) to the libs directory in the project. Do not rename the lib folder. just close eclipse, create new folder libs under the main folder of your project, copy the jars in the libs directory, open eclipse, use right click on the libs folder (this time inside eclipse) and select REFRESH and your added jars will appear. Then run the project. In my case it worked.

这篇关于Apache的类定义未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆