Problems with Commons-codec-1.6.jar for Base64 codec in Android

Source: Internet
Author: User

An exception occurred while encoding:

Java.lang.NoSuchMethodError:No static Method Encodebase64string ([B) ljava/lang/string; in class lorg/apache/commons/ Codec/binary/base64; or its Super classes (Declaration of ' org.apache.commons.codec.binary.Base64 ' appears in/system/framework/ Org.apache.http.legacy.boot.jar)

Decoding problem:

Java.lang.NoSuchMethodError:No static method DecodeBase64 (ljava/lang/string;) [B in class lorg/apache/commons/codec/ Binary/base64; or its Super classes (Declaration of ' org.apache.commons.codec.binary.Base64 ' appears in/system/framework/ Org.apache.http.legacy.boot.jar)

Through the analysis log, found that because the framework layer of Android system also used Apache COMMONS-CODEC this package, and I introduced in the LIB package conflict ...

Solution: From http://archive.apache.org/dist/commons/codec/binaries/download in the background staff version of the same version of the package source package, directly to the source code directly to use. Don't forget to change the name of the bag!

A half-day effort to re-guide the package, found or not to use, Language.java thrown out of the problem, application started to find our Language and no system, on the problem of this motherfucker. We just have to encode and decode the function, so we just have to delete this package right away .

The last perfect run! Kai Sen. My directory structure is:

========================= "

If you cannot access the above, you can access Commons-codec-1.6-bin.zip

Problems with Commons-codec-1.6.jar for Base64 codec in Android

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.