Skip to content

NoSuchMethodError: No static method encodeBase64URLSafeString #259

@ycoupe

Description

@ycoupe

Hi I have a problem when I create a jwt token like this (I'm on Android):

try {
    Algorithm algorithm = Algorithm.HMAC256("secret");
    String token = JWT.create()
        .withIssuer("auth0")
        .sign(algorithm);
} catch (JWTCreationException exception){
    //Invalid Signing configuration / Couldn't convert Claims.
}

I have this error:

java.lang.NoSuchMethodError: No static method encodeBase64URLSafeString([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) at com.auth0.jwt.JWTCreator.sign(JWTCreator.java:330) at com.auth0.jwt.JWTCreator.access$100(JWTCreator.java:24) at com.auth0.jwt.JWTCreator$Builder.sign(JWTCreator.java:311)

This is my configuration:

ext.androidConfig = [
buildToolsVersion : '27.0.3',
compileSdkVersion : 27,
minSdkVersion : 17,
targetSdkVersion : 27
]

kotlin : '1.2.41'
jsonWebToken : '3.3.0'

Thanks for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions