Categories
discuss

Android Maven build gives trouble processing “javax/xml/namespace/QName.class”:

Following error is showing in Maven console everytime I do Project -> Clean. Only the jar file is built in the target folder, apk file is not getting built. Can anyone please help me to solve this …

Following error is showing in Maven console everytime I do Project -> Clean. Only the jar file is built in the target folder, apk file is not getting built. Can anyone please help me to solve this issue?

Regards,

Sam.

My development environment is;

  • Eclipse Helios
  • Android SDK API level 8
  • Eclipse ADT 10.0.1
  • Maven Integration for Android Development Tools 0.2.5

4/30/11 9:54:07 PM IST: [INFO] skip non existing resourceDirectory D:myworkspaceandroidandroid-test-appsrctestresources 4/30/11 9:54:07 PM IST: [INFO] Not compiling test sources 4/30/11 9:54:07 PM IST: [INFO] Tests are skipped. 4/30/11 9:54:07 PM IST: [INFO] D:myandroid-sdk-myandroid-sdk-windows/platform-tools/dx.bat [–dex, –output=D:myworkspaceandroidandroid-test-apptargetclasses.dex, D:myworkspaceandroidandroid-test-apptargetandroid-classes] 4/30/11 9:54:17 PM IST: [INFO] 4/30/11 9:54:17 PM IST: [INFO] trouble processing “javax/xml/namespace/QName.class”: 4/30/11 9:54:17 PM IST: [INFO] 4/30/11 9:54:17 PM IST: [INFO] Ill-advised or mistaken usage of a core class (java.* or javax.*) 4/30/11 9:54:17 PM IST: [INFO] when not building a core library. 4/30/11 9:54:17 PM IST: [INFO] 4/30/11 9:54:17 PM IST: [INFO] This is often due to inadvertently including a core library file 4/30/11 9:54:17 PM IST: [INFO] in your application’s project, when using an IDE (such as 4/30/11 9:54:17 PM IST: [INFO] Eclipse). If you are sure you’re not intentionally defining a 4/30/11 9:54:17 PM IST: [INFO] core class, then this is the most likely explanation of what’s 4/30/11 9:54:17 PM IST: [INFO] going on. 4/30/11 9:54:17 PM IST: [INFO] 4/30/11 9:54:17 PM IST: [INFO] However, you might actually be trying to define a class in a core 4/30/11 9:54:17 PM IST: [INFO] namespace, the source of which you may have taken, for example, 4/30/11 9:54:17 PM IST: [INFO] from a non-Android virtual machine project. This will most 4/30/11 9:54:17 PM IST: [INFO] assuredly not work. At a minimum, it jeopardizes the 4/30/11 9:54:17 PM IST: [INFO] compatibility of your app with future versions of the platform. 4/30/11 9:54:17 PM IST: [INFO] It is also often of questionable legality. 4/30/11 9:54:17 PM IST: [INFO] 4/30/11 9:54:17 PM IST: [INFO] If you really intend to build a core library — which is only 4/30/11 9:54:17 PM IST: [INFO] appropriate as part of creating a full virtual machine 4/30/11 9:54:17 PM IST: [INFO] distribution, as opposed to compiling an application — then use 4/30/11 9:54:17 PM IST: [INFO] the “–core-library” option to suppress this error message. 4/30/11 9:54:17 PM IST: [INFO] 4/30/11 9:54:17 PM IST: [INFO] If you go ahead and use “–core-library” but are in fact 4/30/11 9:54:17 PM IST: [INFO] building an application, then be forewarned that your application 4/30/11 9:54:17 PM IST: [INFO] will still fail to build or run, at some point. Please be 4/30/11 9:54:17 PM IST: [INFO] prepared for angry customers who find, for example, that your 4/30/11 9:54:17 PM IST: [INFO] application ceases to function once they upgrade their operating 4/30/11 9:54:17 PM IST: [INFO] system. You will be to blame for this problem. 4/30/11 9:54:17 PM IST: [INFO] 4/30/11 9:54:17 PM IST: [INFO] If you are legitimately using some code that happens to be in a 4/30/11 9:54:17 PM IST: [INFO] core package, then the easiest safe alternative you have is to 4/30/11 9:54:17 PM IST: [INFO] repackage that code. That is, move the classes in question into 4/30/11 9:54:17 PM IST: [INFO] your own package namespace. This means that they will never be in 4/30/11 9:54:17 PM IST: [INFO] conflict with core system classes. JarJar is a tool that may help 4/30/11 9:54:17 PM IST: [INFO] you in this endeavor. If you find that you cannot do this, then 4/30/11 9:54:17 PM IST: [INFO] that is an indication that the path you are on will ultimately 4/30/11 9:54:17 PM IST: [INFO] lead to pain, suffering, grief, and lamentation. 4/30/11 9:54:17 PM IST: [INFO] 4/30/11 9:54:17 PM IST: [INFO] 1 error; aborting

Answer

If your are using android maven integration, you should add the “provided” scope in your android sdk dependency.

<dependency>        
<groupId>com.google.android</groupId>        
<artifactId>android</artifactId>        
<version>2.3.3</version>        
<scope>provided</scope>        
</dependency>
Source: stackoverflow
Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Privacy Policy, and Copyright Policy. Content is available under CC BY-SA 3.0 unless otherwise noted. The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 © No Copyrights, All Questions are retrived from public domain..