The code works in a normal Java project, but if I try it on Android, copying the library (.jar) dependencies, it will fail to build:

> 
> warning: Ignoring InnerClasses attribute for an anonymous inner class
>  (org.apache.commons.collections.BeanMap$1) that doesn't come with an
>  associated EnclosingMethod attribute. This class was probably produced by a
>  compiler that did not target the modern .class file format. The recommended
>  solution is to recompile the class from source, using an up-to-date compiler
>  and without specifying any "-target" type options. The consequence of ignoring
>  this warning is that reflective operations on this class will incorrectly
>  indicate that it is *not* an inner class.
> 
> 
> 

It finally says:

> 
> 6 warnings
>  1 error; aborting
>  /home/kp/android-sdk-linux/tools/ant/build.xml:818: The following error occurred while executing this line:
>  /home/kp/android-sdk-linux/tools/ant/build.xml:820: The following error occurred while executing this line:
>  /home/kp/android-sdk-linux/tools/ant/build.xml:832: The following error occurred while executing this line:
>  /home/kp/android-sdk-linux/tools/ant/build.xml:278: null returned: 1
> 
> 
> 

I added all the libraries:

* commons-codec-1.4.jar
* commons-collections-3.2.1.jar
* commons-io-2.0.1.jar
* commons-lang-2.6.jar
* commons-logging-1.1.1.jar
* cssparser-0.9.5.jar
* htmlunit-2.9.jar
* htmlunit-core-js-2.9.jar
* httpclient-4.1.2.jar
* httpcore-4.1.2.jar
* httpmime-4.1.2.jar
* nekohtml-1.9.15.jar
* sac-1.3.jar
* serializer-2.7.1.jar
* xalan-2.7.1.jar
* xercesImpl-2.9.1.jar
* xml-apis-1.3.04.jar

If I remove some dependencies, it will build but when it tries to execute my code `_client = new WebClient();` I get noClassDefFoundError errors.

I haven't found a solution yet nowhere, so if you have the solution please share!