0

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.

Valery Viktorovsky
  • 6,487
  • 3
  • 39
  • 47
ChinaMan
  • 39
  • 2
  • 12
  • Would it be possible for you to link to the "JSON jar files i always use in JSE project"? Or would that be too tedious? – CommonsWare May 20 '12 at 15:18
  • i import the JSON jar by adding new library in the Java Build Path. and all the classes in the imported jar such as "net.sf.json.JSONArray" can be resovled in my ANROID code. but i'm not able to lauch the project. and today i tried on another pc. this time "Could not find class 'net.sf.json.JSONArray'" problem occurs. – ChinaMan May 21 '12 at 05:56

2 Answers2

3

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.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
0

select project

  1. right click go to properties and select java build path.

2.select libraries tag

3.click add external jar. select the jar file . CLICK OK. That's all you need to do.

sachi
  • 2,122
  • 7
  • 30
  • 46