Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules guava-20.0.jar (com.google.guava:guava:20.0)

2020 Solution

Google knows about this error so they made a special package to fix the conflict.

Add this to your build.gradle

implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'

I found the solution at How to solve Program type already present: com.google.common.util.concurrent.ListenableFuture?. user2297550 said:

I merely added implementation 'com.google.guava:guava:27.0.1-android' at the end of my app gradle file and the error went away.

That was the solution for me. Now I have this and my app compiles correctly:

implementation 'com.google.firebase:firebase-inappmessaging-display:17.2.0'
implementation 'com.google.guava:guava:27.0.1-android'

Add this line in build.gradle

    implementation 'com.google.guava:guava:27.0.1-android'