ini4j only works from the libs directory, not maven

407 views Asked by At

I'm trying to use ini4j in an Android app, compiled in the AIDE IDE. When I put ini4j-0.5.4.jar in the libs folder in my app, it works. However, when I include ini4j with the line compile 'org.ini4j:ini4j:0.5.4' in my build.gradle, I get the error bad utf-8 byte a0 at offset 00000004. I've checked the jar file in the Maven directory, and it is identical to the one in my libs folder. Both have the SHA1 4a3ee4146a90c619b20977d65951825f5675b560. I have absolutely no clue what could be causing this.

EDIT: For some reason, it seems to have xerces as a dependency, which is the library known to have these issues.

1

There are 1 answers

1
BenjaminWegener On

According to Apache (http://xerces.apache.org/xerces2-j/install.html) xerces.jar is now deprecated and renamed to xercesImpl.jar, so you have to stick to the old JAR.

xerces.jar is no longer available in the main distribution. You can still download this jar from deprecated distribution. xerces.jar is a Jar file that contains all the parser class files (i.e., it contains the intersection of the contents of xercesImpl.jar and xml-apis.jar).

To be clearer, the technical details are:

  1. The old xerces.jar you have in your libs folder is working, because of the internal folder structure.

  2. The new xerces from the repository has a different folder structure and some weird UTF encoded bytes AIDE is not understanding.