The hex.encodehexstring (byte[] input) method under the Org.apache.commons.codec.jar package is used for encryption in Android projects. The result is compiled, and the runtime is always reported java.lang.NoSuchMethodError:org.apache.commons.codec.binary.Hex.encodeHexString ([B) ljava/lang/ String; error.
Reason: Google Android also has a package name of the same project, and the same class name, the key point is not the method! Therefore, the package name conflict, because of the Java call mechanism, the system first found in its own inside the same name of this class, and then to call the system itself the method under the class. However, the system does not have that method at all, so error.
Solution: Use Eclipse to download the source code, repackage it, modify the original package name, and then re-introduce it to the project.
Solve the problem of introducing Codec.jar packet error in Android project