2

I want to use commons-lang3 in my project, with Android Studio.

Here is my gradle configuration:

compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.4'

Gradle build is done without error, I can use StringUtils. But in runtime, app crashes with this error:

 java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/commons/lang/StringUtils;

I also tried with .jar in lib folder but I get the same error.

gvlasov
  • 18,638
  • 21
  • 74
  • 110
Florian Mac Langlade
  • 1,863
  • 7
  • 28
  • 57

1 Answers1

1

change your gradle file to this:

implementation 'org.apache.commons:commons-lang3:3.6'

then you can use this import in your classes:

import org.apache.commons.lang3.StringUtils;
João Carlos
  • 1,405
  • 1
  • 15
  • 21