HUSAIN LOKHANDWALA
HUSAIN LOKHANDWALA

Reputation: 1

Flutter Deferred Component error on adding com.google.android.play:core:1.8.0: failing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable

I am trying to add deferred components in my flutter projects by following this doc here

The first mentions to add this dependency implementation "com.google.android.play:core:1.8.0" in my android/app/build.gradle file. I am getting errors on flutter run where it mentions duplicate classes.

This is my dependency section in build.gradle file

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation project(':unityLibrary')
    implementation 'com.google.android.play:core:1.8.0'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.google.firebase:firebase-messaging:23.3.1'
    implementation 'androidx.appcompat:appcompat:1.0.0'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'com.facebook.android:facebook-android-sdk:[8,9)'
    implementation 'com.github.bumptech.glide:glide:4.9.0'
    implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
    implementation(name: "paynimo_v4.5.7_live", ext: 'jar')
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation(name: "audience_sdk-release", ext: 'aar')
    implementation "me.leolin:ShortcutBadger:1.1.22@aar"
    implementation 'com.github.anrwatchdog:anrwatchdog:1.4.0'
    implementation 'com.google.firebase:firebase-crashlytics:18.6.0'
    implementation 'com.amazon.android.amazonpay:apay-hardened-android-sdk-sso:1.1.13'
}
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.gms.google-services'

configurations.all {
    resolutionStrategy {
        force 'com.google.android.gms:play-services-auth:20.7.0'
    }
}

And these are the errors

> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class com.google.android.play.core.appupdate.AppUpdateInfo found in modules jetified-app-update-2.1.0-runtime (com.google.android.play:app-update:2.1.0) and jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0)
     Duplicate class com.google.android.play.core.appupdate.AppUpdateManager found in modules jetified-app-update-2.1.0-runtime (com.google.android.play:app-update:2.1.0) and jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0)
     Duplicate class com.google.android.play.core.appupdate.AppUpdateManagerFactory found in modules jetified-app-update-2.1.0-runtime (com.google.android.play:app-update:2.1.0) and jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0)
     Duplicate class com.google.android.play.core.appupdate.AppUpdateOptions found in modules jetified-app-update-2.1.0-runtime (com.google.android.play:app-update:2.1.0) and jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0)
     Duplicate class com.google.android.play.core.appupdate.AppUpdateOptions$Builder found in modules jetified-app-update-2.1.0-runtime (com.google.android.play:app-update:2.1.0) and jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0)
     Duplicate class com.google.android.play.core.appupdate.testing.FakeAppUpdateManager found in modules jetified-app-update-2.1.0-runtime (com.google.android.play:app-update:2.1.0) and jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0)
     Duplicate class com.google.android.play.core.common.IntentSenderForResultStarter found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-core-common-2.0.3-runtime (com.google.android.play:core-common:2.0.3)
     Duplicate class com.google.android.play.core.common.LocalTestingException found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-core-common-2.0.3-runtime (com.google.android.play:core-common:2.0.3)
     Duplicate class com.google.android.play.core.common.PlayCoreDialogWrapperActivity found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-core-common-2.0.3-runtime (com.google.android.play:core-common:2.0.3)
     Duplicate class com.google.android.play.core.install.InstallException found in modules jetified-app-update-2.1.0-runtime (com.google.android.play:app-update:2.1.0) and jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0)
     Duplicate class com.google.android.play.core.install.InstallState found in modules jetified-app-update-2.1.0-runtime (com.google.android.play:app-update:2.1.0) and jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0)
     Duplicate class com.google.android.play.core.install.InstallStateUpdatedListener found in modules jetified-app-update-2.1.0-runtime (com.google.android.play:app-update:2.1.0) and jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0)
     Duplicate class com.google.android.play.core.install.NativeInstallStateUpdateListener found in modules jetified-app-update-2.1.0-runtime (com.google.android.play:app-update:2.1.0) and jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0)
     Duplicate class com.google.android.play.core.install.model.ActivityResult found in modules jetified-app-update-2.1.0-runtime (com.google.android.play:app-update:2.1.0) and jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0)
     Duplicate class com.google.android.play.core.install.model.AppUpdateType found in modules jetified-app-update-2.1.0-runtime (com.google.android.play:app-update:2.1.0) and jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0)
     Duplicate class com.google.android.play.core.install.model.InstallErrorCode found in modules jetified-app-update-2.1.0-runtime (com.google.android.play:app-update:2.1.0) and jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0)
     Duplicate class com.google.android.play.core.install.model.InstallStatus found in modules jetified-app-update-2.1.0-runtime (com.google.android.play:app-update:2.1.0) and jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0)
     Duplicate class com.google.android.play.core.install.model.UpdateAvailability found in modules jetified-app-update-2.1.0-runtime (com.google.android.play:app-update:2.1.0) and jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0)
     Duplicate class com.google.android.play.core.listener.StateUpdatedListener found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-core-common-2.0.3-runtime (com.google.android.play:core-common:2.0.3)
     Duplicate class com.google.android.play.core.review.ReviewInfo found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
     Duplicate class com.google.android.play.core.review.ReviewManager found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
     Duplicate class com.google.android.play.core.review.ReviewManagerFactory found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
     Duplicate class com.google.android.play.core.review.testing.FakeReviewManager found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)

In my pubspec.yaml I am also using these 2 packages:

  in_app_update:
    git:
      url: https://github.com/rajatjg/flutter_in_app_update
      ref: v1.0.0
  in_app_review: "^2.0.6"

What am I missing?

My final goal is to be able to setup config to use deferred components in my project

Upvotes: 0

Views: 127

Answers (0)

Related Questions