Duplicate jar (ListenableFuture.class) while migrating to New Place SDK google

new places SDK is working but when you migrate to android x it's not working

so add these below lines in app/build dependencies

dependencies {
    implementation ('com.google.android.libraries.places:places:1.0.0'){
        exclude group: 'com.google.guava', module: 'listenablefuture'
    }
}

android {
   configurations{
       all*.exclude group: 'com.google.guava', module: 'listenablefuture'
   }
}

Add this dependency to your build:

api 'com.google.guava:guava:28.1-android'

The solution didn't work for me, but after I updated to 2.0.0 things get fixed, version 1.0.0 was giving the error, so use:

implementation 'com.google.android.libraries.places:places:2.0.0'

SOLVED: Finally found a solution. I stated earlier listenable future duplication was found while adding new dependency library for places SDK, duplicate being in the AppCompat library.

I was using the latest AppCompat library and here was the problem. It seems as per google docs, stable version is 1.0.0. So once I revert back everything to the stable version, the problem was solved.

implementation 'androidx.appcompat:appcompat:1.0.0'

And no need of below:

configurations {
    all*.exclude group: 'com.google.guava', module: 'listenablefuture'
}