Answer the question
In order to leave comments, you need to log in
Android. Why is a strange error reported in the application's runtime?
It was necessary to include a library for working with the BitTorrent protocol into the project. I work on Android Studio 1.0.2 (osx), JDK8. I connected the ttorrent: 1.4 maven repository via gradle and just started to enjoy life, when an amazing error arose inside ttorrent:
java.lang.NoSuchMethodError: No static method encodeHex([BZ)[C in class Lorg/apache/commons/codec/binary/Hex; or its super classes (declaration of 'org.apache.commons.codec.binary.Hex' appears in /system/framework/ext.jar)
Answer the question
In order to leave comments, you need to log in
Actually the solution turned out to be more complicated than I thought. So, let's start with the fact that I came across an article on the Internet Dieser Beitrag, from which it is clear that I was not the only one who had similar problems. The whole point turned out to be that within the Android operating system itself there are ALREADY some libraries that have a higher usage priority than those loaded with dependencies along with the application. Among them is my org.apache.commons.codec. Yes, yes, things like that. There are two ways to solve the problem, either download the libraries you need and use the builder to rename the project (for example, org.apache.commons.codec to org.apache.commons.codec.android), build a .jar nickname from it, include it in project and import the necessary classes in the code only from "our" library, or simply pull the necessary class into your project and not drag unnecessary megabytes of code along with you. However, that's exactly what I did.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question