5

I am developing an Android application which requires the use of commons-beanutils library, however I am unable to get it compiling. When I try to run an application with this jar file, I get several of these errors appearing

Dx warning: Ignoring InnerClasses attribute for an anonymous inner class (org.apache.commons.beanutils.locale.LocaleBeanUtilsBean$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.

Then this error appears

Unable to execute dex: Multiple dex files define Lorg/apache/commons/beanutils/DynaBean;

I have googled both errors and getting several different answers on how to resolve this.

Unable to execute dex: Multiple dex files define Lcom/myapp/R$array;

This link here states that the bin folder is the problem. I tried deleting it but same issue.

I then came across this thread

Are there Android compatible alternatives to Property Utils?

the op states that beans util does not work on Android. Is this accurate? If so is there an alternative that would work? Would recompiling the class from source work?

Any help would be much appreciated!

Edit: I also tried downloading the latest versions of commons-beanutils, same issue

Community
  • 1
  • 1
AdamM
  • 4,400
  • 5
  • 49
  • 95

1 Answers1

0

There is bridge library which works on Android: android-java-air-bridge.jar. Just include into project path and use all apache beanutils features in your Android project as you could use in ordinary java application. Moreover, there are lot of other classes which moved to this Android supporting library. Look at the list.

Above solution was mentioned at Are there Android compatible alternatives to Property Utils?

Community
  • 1
  • 1
N.S.
  • 269
  • 3
  • 9