1

I am having issues with app crashing and giving this stack trace

java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/commons/codec/digest/DigestUtils;
                      at com.ryko.fstwo.wrapper.DigestUtilsWrapper.sha1(DigestUtilsWrapper.java:7)
...
Didn't find class "org.apache.commons.codec.digest.DigestUtils" on path: <really long path name>

I have gone through all the threads on here I can find about this problem, but cant find a resolution. In my libs folder I have commons-collections-3.2.1.jar, In my dependencies section on build.gradle I have

compile 'org.apache.commons:commons-collections4:4.1' and

compile files('libs/commons-collections-3.2.1.jar').

I have read through these but can't find a working solution 1, 2, 3 and many others

Community
  • 1
  • 1
wizloc
  • 2,202
  • 4
  • 28
  • 54

2 Answers2

3

I guess that you need a dependency to commons-codec. It is available in maven central repo.

For example, add this to the dependencies section of your build.gradle:

compile group: 'commons-codec', name: 'commons-codec', version: '1.10'

Or you you prefer the shorter option:

compile group: 'commons-codec:commons-codec:1.10'
Lachezar Balev
  • 11,498
  • 9
  • 49
  • 72
  • I tried this but still same error. I have Didn't find class "org.apache.commons.codec.digest.DigestUtils" on path: at bottom of stack trace that I shoulld include in original question if it helps – wizloc Dec 19 '16 at 19:15
  • If you you download the jar file from maven central and unpack it you will see that the class is there. There is something wrong with the way that you package and run your application... Maybe you may provide extra details about this. The class is certainly within the jar file. – Lachezar Balev Dec 19 '16 at 19:19
1

you need have changes,such as

dependencies {
   implementation 'commons-codec:commons-codec:1.10'
}
Paul Roub
  • 36,322
  • 27
  • 84
  • 93
xiaow
  • 11
  • 1