2

I'm trying to use LastModifiedFileComparator referring http://www.avajava.com/tutorials/lessons/how-do-i-sort-an-array-of-files-according-to-their-last-modified-dates.html in Android.LastModifiedFileComparator isnt being resolved by using the import statement -

import org.apache.commons.io.comparator.LastModifiedFileComparator;

I've added the following statement in the dependencies, but it's still not working. Please help.

 compile 'org.apache.commons:commons-io:1.3.2'
zek54
  • 415
  • 3
  • 20

2 Answers2

1

guys If you are not able to resolve this LastModifiedFileComparator problem, Here is the solution I have found.

Step 1
Open app level build.gradle and add dependency as below. To get updated version click here

implementation group: 'commons-io', name: 'commons-io', version: '2.0.1'

Step 2
If it did't work than Add mavenCentral() creating new repositories in your app level build.gradle

repositories{
   mavenCentral()
}
dependencies {
//all implementation

That all It should work like charm, If not please refer here

Kunchok Tashi
  • 2,413
  • 1
  • 22
  • 30
0

Try adding mavenCentral() in repositories in Project level Gradle File.