skip to Main Content

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:checkReleaseDuplicateClasses’.
    Duplicate class com.google.firebase.Timestamp found in modules jetified-firebase-common-21.0.0-runtime (com.google.firebase:firebase-common:21.0.0) and jetified-firebase-firestore-24.0.0-runtime (com.google.firebase:firebase-firestore:24.0.0)

Duplicate class com.google.firebase.Timestamp found in modules jetified-firebase-common-21.0.0-runtime (com.google.firebase:firebase-common:21.0.0) and

Duplicate class com.google.firebase.Timestamp found in modules jetified-firebase-common-21.0.0-runtime (com.google.firebase:firebase-common:21.0.0) and jetified-firebase-firestore-24.0.0-runtime (com.google.firebase:firebase-firestore:24.0.0)

2

Answers


  1. add = > include ‘:@react-native-firebase_app’ project(‘:@react-native-firebase_app’).projectDir = new File(rootProject.projectDir, ‘../node_modules/@react-native-firebase/app/android’) in settings.gradle dont work for me. Did you do anything different besides that?

    my firebase versions:

    "@react-native-firebase/analytics": "17.5.0",
    "@react-native-firebase/app": "17.5.0",
    "@react-native-firebase/auth": "17.5.0",
    "@react-native-firebase/firestore": "17.5.0",
    

    The error:

    > FAILURE: Build failed with an exception.
    > 
    >     * What went wrong: Execution failed for task ':app:checkDebugDuplicateClasses'.
    >     > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
    >        > Duplicate class com.google.firebase.Timestamp found in modules jetified-firebase-common-21.0.0-runtime
    > (com.google.firebase:firebase-common:21.0.0) and
    > jetified-firebase-firestore-24.10.3-runtime
    > (com.google.firebase:firebase-firestore:24.10.3)
    
    Login or Signup to reply.
  2. I have same issue occurred in my react native firebase project. I have fixed the issue by changing in android/app/build.gradle file.

    Note : versions for Firebase SDKs are chosen automatically by the BoM, so just remove or modify if any firebase dependency ends with specific version or :+

    In my case, I am not using firebase analytics in my app but it still implemented in gradle file. So, I have comment 1 firebase dependency com.google.firebase:firebase-analytics:+ and my issue resolved.

    Don’t forget to remove node_modules and clean Android build folder before rebuild. Thanks 😊👍.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search