0

I am developing an Android App that uses the Google APIs Client Library for Java version 1.12.0. I have added the jar files to the /libs folder (and not to a new /lib folder). I get the following error during run-time:

Dx trouble processing "javax/xml/namespace/QName.class":

Ill-advised or mistaken usage of a core class (java.* or javax.*) when not building a core library.

I am NOT using Maven though, and all the answers by others seem to make use of Maven.

Android version - 4.1.2 API level 16 Eclipse - Java EE Juno

Any suggestions on how I can solve this?

Shalini
  • 1
  • 1
  • 3
  • 1
    Right click on your project select java build path >> Add external libraries and browse to the jar that you want to add. – Grant Nov 24 '12 at 16:47
  • I did this, but got 'Class X not found referenced from within Y method' errors – Shalini Nov 24 '12 at 17:07

5 Answers5

0

A Best way to add External Jars to your Android Project or any Java project is:

Create a folder called 'libs' into you project root folder Copy your Jar files to the libs folder Now right click on the Jar file and then select Build Path > Add to Build Path, this will create a folder called 'Referenced Library' into you project, and your are done By do doing like this, whenever you transfer you project to other Computer, you will not miss your libraries which are being referenced to some space on your Hard drive.

Valery Viktorovsky
  • 6,487
  • 3
  • 39
  • 47
Ajay S
  • 48,003
  • 27
  • 91
  • 111
  • The /libs folder was already there and I added the jar files to it and have added the same to the build path, but I keep getting the same error – Shalini Nov 24 '12 at 17:12
0

You should put jar in libs folder and then Project -> Properies -> Java Buid Path -> Add JARs -> Select jar of your library from libs folder -> OK.

Artyom Kiriliyk
  • 2,513
  • 1
  • 17
  • 21
  • Please look at this [post](http://stackoverflow.com/questions/10098088/dalvik-vm-error-exception-found-javax-xml-namespace-qname-class) I think it's the same as yours. – Artyom Kiriliyk Nov 24 '12 at 18:28
  • Thanks, this post helped me. I had to delete xpp3-1.1.4c.jar and a couple of other jar files, which my application was not using. – Shalini Nov 27 '12 at 04:17
0

I don't know if you got a solution yet. I post this here to help someone in the future with the same problem.

Basically I had to remove "android.jar" from the build path, keeping the "Android X.X" library. Then, clean the project.

This is the link

jose
  • 256
  • 2
  • 7
0

following here

window->preference->compiler->jre1.6 after do project->properties->java build path-> addlibrary->jresystemlibrary->environment->choose your jre

it will solve the problem

Mikhail_Sam
  • 10,602
  • 11
  • 66
  • 102
-2

You follow this steps to add external jar in your project

Step 1

Step 1

Step 2

Step 2

Step 3

Step 3

RajeshVijayakumar
  • 10,281
  • 11
  • 57
  • 84
  • Dx trouble processing "javax/xml/namespace/QName.class": Ill-advised or mistaken usage of a core class (java.* or javax.*) when not building a core library. – Shalini Nov 24 '12 at 17:24
  • LogCat has nothing, I have pasted what is there on the console: – Shalini Nov 24 '12 at 17:28
  • [2012-11-24 08:08:08 - OOProject] Dx trouble processing "javax/xml/namespace/QName.class": Ill-advised or mistaken usage of a core class (java.* or javax.*) when not building a core library. [2012-11-24 08:08:08 - OOProject] Dx trouble processing "javax/xml/namespace/QName.class": Ill-advised or mistaken usage of a core class (java.* or javax.*) when not building a core library. This is often due to inadvertently including a core library file in your application's project, when using an IDE (such as Eclipse). .... – Shalini Nov 24 '12 at 17:32
  • Take a look at this : http://stackoverflow.com/questions/5843143/android-maven-build-gives-trouble-processing-javax-xml-namespace-qname-class – RajeshVijayakumar Nov 24 '12 at 19:18
  • The solution is for Android + Maven, I am not using Maven. Also, one post says that the error is because of xpp3 jar dependencies, I deleted the jar file, but that also did not help me. Is there any other way to exclude dependencies? like adding it to an XML file? (the way they do it for Maven) – Shalini Nov 24 '12 at 21:02