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

it2026-02-20  18

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);

转载于:https://www.cnblogs.com/akiha/p/5824746.html

相关资源:org.apache.commons.codec包
最新回复(0)