Phan Dinh Thai Phan Dinh Thai - 1 year ago 210
Android Question

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

Due to this question
I want to use class

in package

But when I try to import
lib by add line
compile 'org.apache.commons:commons-collections4:4.0'
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 Source

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'


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download