0

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.

beewall
  • 131
  • 1
  • 10

1 Answers1

0

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.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
  • I'm not using Xerces, or at least not trying to. I mean ini4j doesn't work unless I include the ini4j jar, because somewhere along the dependency tree ini4j requires it (it doesn't show on the dependency tree on their site, so it's at least a dependency of a dependency of a dependency, but I'm not sure what for). – beewall Jul 01 '18 at 17:51