3

I'm trying to use Firebase token generator but I always get this error

        java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString

I use commons codec 1.10. I don't know whether is there a conflict or not. I'm just lost.

Please, help.

mnagy
  • 1,085
  • 1
  • 17
  • 36

1 Answers1

1

What version of Android are you using? Android already includes an older version of commons-codec:

Discussion about this problem

Also here: SO discussion

You are talking about:

encodeBase64URLSafeString

The method is since 1.4:

1.10 commons-codec Javadoc

In this Firebase token generator I can see:

  <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <version>1.7</version>
    </dependency>

I guess you probably have an older version on the classpath then.

Community
  • 1
  • 1
ACV
  • 9,964
  • 5
  • 76
  • 81