如何导入外部JSON JAR文件到Android项目 [英] how to import external JSON jar file into ANDROID project

查看:395
本文介绍了如何导入外部JSON JAR文件到Android项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要一些数据转换成JSON传输。但是,由于有关JSON android的方法是相当繁琐。我创建了一个用户库,并导入一些JSON jar文件,我总是在JSE项目中使用。然后当我推出的Andr​​oid项目,Android的出现问题的包装。在问题标签,它说,像描述:转换为Dalvik的格式失败,出现错误1地点:未知类型:Android包装问题。
我检查出的问题,在互联网上,并尝试通过清洁工程修复它。然而,这不是'工作。
人有一定的经验处理这个问题?
请帮助我。
先谢谢了。


解决方案

  

我导入JSON罐子在Java构建路径添加新的库


不要那样做。

相反,创建一个库/ 在您的项目目录,并把JAR那里。如果你是在ADT的Eclipse插件的最新版本,让你的JAR在库/ 会自动将其添加到您的构建路径,并会自动包含在JAR的内容您的APK。

i want to convert some data into JSON to transmit. but since the android methods about JSON are quite tedious. i create a user library and import some JSON jar files i always use in JSE project. then when i launch the android project, Android Packaging Problem occurs. in the problem tag, it says like " Description: Conversion to Dalvik format failed with error 1 Location: Unknown Type: Android Packaging Problem". i check out the problem on the internet, and try to fix it by CLEANING the project. however, it doesn' work. somebody has some experience dealing with this problem? pls help me. thanks in advance.

解决方案

i import the JSON jar by adding new library in the Java Build Path

Do not do that.

Instead, create a libs/ directory in your project and put the JAR there. If you are on the latest version of the ADT plugin for Eclipse, having your JAR be in libs/ will automatically add it to your build path and will automatically include the JAR's contents in your APK.

这篇关于如何导入外部JSON JAR文件到Android项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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