[SOLVED] Flutter : Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules guava-20.0.jar

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Problem

Launching lib\main.dart on sdk gphone x86 in debug mode...
Parameter format not correct -
Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-1.2.1\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_auth-1.3.0\android\src\main\java\io\flutter\plugins\firebase\auth\FlutterFirebaseAuthPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_local_notifications-5.0.0+1\android\src\main\java\com\dexterous\flutterlocalnotifications\FlutterLocalNotificationsPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\google_maps_flutter-2.0.3\android\src\main\java\io\flutter\plugins\googlemaps\Convert.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\google_maps_flutter-2.0.3\android\src\main\java\io\flutter\plugins\googlemaps\TileProviderController.java uses unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.
Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\google_sign_in-4.5.9\android\src\main\java\io\flutter\plugins\googlesignin\GoogleSignInPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\image_cropper-1.4.1\android\src\main\java\vn\hunghd\flutter\plugins\imagecropper\ImageCropperPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\launch_review-3.0.1\android\src\main\java\com\iyaffle\launchreview\LaunchReviewPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules guava-20.0.jar (com.google.guava:guava:20.0) and listenablefuture-1.0.jar (com.google.guava:listenablefuture:1.0)

  Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 48s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

Solution

Step 1. Added implementation ‘com.google.guava:guava:27.0.1-android’ at the end of my android/app/build.gradle file and the error went away.

Source:- Stackoverflow

Step 2. Run flutter clean, flutter pub get and run your project.

That’s all.

I hope it fixed your error.

Keep Coding.