Phan Dinh Thai Phan Dinh Thai - 25 days ago 9
Android Question

How to add org.apache.commons.lang3 to AndroidStudio with gradle

Due to this question
I want to use class

StringEscapeUntils
in package
org.apache.commons.lang3
.

But when I try to import
Apache
lib by add line
compile 'org.apache.commons:commons-collections4:4.0'
to
build.grade
file then can not import the class above.

Is there any one can help me how to import above one to my project via gradle (not by download .jar and put them into project folder).

Answer

I think dependency for StringUtils you are using is not proper..

Please add belowe dependency to gradle and Sync project and import your class..

compile 'org.apache.commons:commons-lang3:3.5'

Edited : Also new version is available :

compile 'org.apache.commons:commons-lang3:3.4'

Thanks..!!