ANDROID : java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.encodeBase64String in android


The org.apache.commons.codec.binary.Base64 class is not part of the standard Android APIs. To fix the problem, just use the standard Base64 class that comes with Android by replacing these lines:

import org.apache.commons.codec.binary.Base64;
...
String retVal = Base64.encodeBase64String(digest);

by:

import android.util.Base64;
...
String retVal = Base64.encodeToString(digest, Base64.DEFAULT);


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM