Alexandr

Smack 4.1.0-rc2 using Maven on Android: Need to exclude 'xpp3' artifact

Discussion created by Alexandr on Feb 25, 2015
Latest reply on Mar 13, 2015 by Flow

I tried to add Smack 4.1.0-rc2 to my project by adding this lines to pom.xml:

 

<dependency>
  <groupId>org.igniterealtime.smack</groupId>
  <artifactId>smack-android-extensions</artifactId>
  <version>4.1.0-rc2</version>
</dependency>

<dependency>
  <groupId>org.igniterealtime.smack</groupId>
  <artifactId>smack-tcp</artifactId>
  <version>4.1.0-rc2</version>
</dependency>

 

But I get an error:

 

 

[INFO] --- android-maven-plugin:4.1.1:dex (default-dex) @ mopc ---

[INFO] Convert classes to Dex : /Users/aleksandrplusnin/mopc/mopc/target/classes.dex

[INFO] warning: Ignoring InnerClasses attribute for an anonymous inner class

[INFO] (org.apache.commons.validator.ValidatorResources$1) that doesn't come with an

[INFO] associated EnclosingMethod attribute. This class was probably produced by a

[INFO] compiler that did not target the modern .class file format. The recommended

[INFO] solution is to recompile the class from source, using an up-to-date compiler

[INFO] and without specifying any "-target" type options. The consequence of ignoring

[INFO] this warning is that reflective operations on this class will incorrectly

[INFO] indicate that it is *not* an inner class.

[INFO]

[INFO] trouble processing "javax/xml/namespace/QName.class":

[INFO]

[INFO] Ill-advised or mistaken usage of a core class (java.* or javax.*)

[INFO] when not building a core library.

[INFO]

[INFO] This is often due to inadvertently including a core library file

[INFO] in your application's project, when using an IDE (such as

[INFO] Eclipse). If you are sure you're not intentionally defining a

[INFO] core class, then this is the most likely explanation of what's

[INFO] going on.

[INFO]

[INFO] However, you might actually be trying to define a class in a core

[INFO] namespace, the source of which you may have taken, for example,

[INFO] from a non-Android virtual machine project. This will most

[INFO] assuredly not work. At a minimum, it jeopardizes the

[INFO] compatibility of your app with future versions of the platform.

[INFO] It is also often of questionable legality.

[INFO]

[INFO] If you really intend to build a core library -- which is only

[INFO] appropriate as part of creating a full virtual machine

[INFO] distribution, as opposed to compiling an application -- then use

[INFO] the "--core-library" option to suppress this error message.

[INFO]

[INFO] If you go ahead and use "--core-library" but are in fact

[INFO] building an application, then be forewarned that your application

[INFO] will still fail to build or run, at some point. Please be

[INFO] prepared for angry customers who find, for example, that your

[INFO] application ceases to function once they upgrade their operating

[INFO] system. You will be to blame for this problem.

[INFO]

[INFO] If you are legitimately using some code that happens to be in a

[INFO] core package, then the easiest safe alternative you have is to

[INFO] repackage that code. That is, move the classes in question into

[INFO] your own package namespace. This means that they will never be in

[INFO] conflict with core system classes. JarJar is a tool that may help

[INFO] you in this endeavor. If you find that you cannot do this, then

[INFO] that is an indication that the path you are on will ultimately

[INFO] lead to pain, suffering, grief, and lamentation.

[INFO]

[INFO] 1 error; aborting

 

After some googling I ended up with solution:

 

<dependency>
  <groupId>org.igniterealtime.smack</groupId>
  <artifactId>smack-android-extensions</artifactId>
  <version>4.1.0-rc2</version>
</dependency>

<dependency>
  <groupId>org.igniterealtime.smack</groupId>
  <artifactId>smack-tcp</artifactId>
  <version>4.1.0-rc2</version>
  <exclusions>
  <exclusion>
  <artifactId>xpp3</artifactId>
  <groupId>xpp3</groupId>
  </exclusion>
  </exclusions>
</dependency>

 

Hope it'll be helpful for someone.

Outcomes