I'm working on a fresh install of Flutter. All I did was adding contact services to the pubspec.yaml file and when I try to run it throws build error.
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
simple_permissions: ^0.1.9
contacts_service: ^0.2.4
Launching lib/main.dart on SM G950W in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
D8: Program type already present: android.support.v4.os.ResultReceiver$MyResultReceiver
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/28.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/5.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/40.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/58.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/49.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/34.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/64.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/9.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/61.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/37.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/55.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/43.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/25.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/31.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/67.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/46.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/22.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/52.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/15.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/10.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/6.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/7.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/11.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/14.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/3.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/8.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/12.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/4.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/16.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/2.jar, /home/mithunnath/IdeaProjects/fluttercontactsapp/build/app/intermediates/transforms/dexBuilder/debug/13.jar
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: android.support.v4.os.ResultReceiver$MyResultReceiver
* 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 2s
*******************************************************************************************
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.
*******************************************************************************************
Finished with error: Gradle task assembleDebug failed with exit code 1