skip to Main Content
I am getting this error in my react native project, i found some solutions about 
this error but that was not working for me, solution i found for this error is like 
update your build gradle version and i change build gradle version, but still 
getting same error this is the exact error which i get in android studio.

can anyone help me to solve this problem.

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:processDebugMainManifest’.

Manifest merger failed with multiple errors, see logs

  • Try:
    Run with –info or –debug option to get more log output. Run with –scan to get full insights.

  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:app:processDebugMainManifest’.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$3(ExecuteActionsTaskExecuter.java:186)
    at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:268)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:184)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:173)
    at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
    at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
    at
    ==============================================================================

2: Task 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.yalantis.ucrop.UCrop found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.UCrop$Options found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.UCropActivity found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.UCropActivity$1 found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.UCropActivity$2 found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.UCropActivity$3 found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.UCropActivity$4 found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.UCropActivity$5 found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.UCropActivity$6 found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.UCropActivity$7 found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.UCropActivity$8 found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.UCropActivity$GestureTypes found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.callback.BitmapCropCallback found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.callback.BitmapLoadCallback found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.callback.CropBoundsChangeListener found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.callback.OverlayViewChangeListener found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.model.AspectRatio found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.model.AspectRatio$1 found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.model.CropParameters found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.model.ExifInfo found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.model.ImageState found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.task.BitmapCropTask found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.task.BitmapLoadTask found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.task.BitmapLoadTask$BitmapWorkerResult found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.util.BitmapLoadUtils found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.util.CubicEasing found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.util.EglUtils found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.util.FastBitmapDrawable found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.util.ImageHeaderParser found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.util.ImageHeaderParser$RandomAccessReader found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.util.ImageHeaderParser$Reader found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.util.ImageHeaderParser$StreamReader found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.util.RectUtils found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.util.RotationGestureDetector found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.util.RotationGestureDetector$OnRotationGestureListener found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.util.RotationGestureDetector$SimpleOnRotationGestureListener found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.util.SelectedStateListDrawable found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.view.CropImageView found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.view.CropImageView$WrapCropBoundsRunnable found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)
Duplicate class com.yalantis.ucrop.view.CropImageView$ZoomImageToPosition found in modules jetified-pictureselector-v2.7.3-rc08-runtime (io.github.lucksiege:pictureselector:v2.7.3-rc08) and jetified-ucrop-2.2.6-native-runtime (com.github.yalantis:ucrop:2.2.6-native)

 build.gradle: 

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 24
        compileSdkVersion = 30
        targetSdkVersion = 30
        supportLibVersion = "28.0.0"
        multiDexEnabled = true
    }
    repositories {
        google()
        jcenter()
        jcenter { url "https://jcenter.bintray.com/"}
        maven { url 'https://maven.fabric.io/public' }
        maven { url "https://jitpack.io" }
        maven { url "https://plugins.gradle.org/m2/" }
        maven { url 
        'https://artifactory.img.ly/artifactory/imgly' }
        maven { url "https://dl.bintray.com/android/android- 
        tools/" }
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.2.2"
        classpath 'com.google.gms:google-services:4.3.3'
        classpath 'io.fabric.tools:gradle:1.31.2'
        classpath 'ly.img.android.sdk:plugin:8.3.1'
        classpath 'com.google.firebase:perf-plugin:1.3.1'
        classpath 'ly.img.android.pesdk:plugin:9.1.1'
        classpath 'org.jetbrains.kotlin:kotlin-gradle- 
        plugin:1.4.10'
        classpath "org.jetbrains.kotlin:kotlin-gradle- 
        plugin:1.4.10"
        classpath 'ly.img.android.sdk:plugin:9.1.0'
    }
}

allprojects {
    repositories {
        mavenLocal()
        maven {
            url("$rootDir/../node_modules/react- 
            native/android")
        }
        maven {
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        maven { url 
        'https://artifactory.img.ly/artifactory/imgly' }
        google()
        maven { url "https://jitpack.io" }
        maven { url 'https://maven.google.com' }
        mavenCentral()
        jcenter()
        jcenter { url "https://jcenter.bintray.com/" }
    }
 }

2

Answers


  1. I think issue is coming some where in crop image class I am not able to identify the library but this what worked for me :

    1. Add to android/gradle.properties:
    android.enableJetifier=true
    android.useAndroidX=true
    
    1. yarn add jetifier

    2. In android directory run: ./gradlew clean

    3. Run: yarn jetify in your project directory

    4. react-native run-android

    Another solution :

    replace : implementation 'com.github.yalantis:ucrop:2.2.6-native' to

     implementation 'io.github.lucksiege:pictureselector:v2.7.3-rc08'
    

    then go to

    node_modules/react-native-image-crop-picker/android/src/main/java/com/reactnative/ivpusic/imagepicker/PickerModule.java

    add import androidx.appcompat.app.AppCompatActivity; to imports and replace uCrop.start(activity); to uCrop.start(activity, UCrop.REQUEST_CROP);

    Reference : https://githubmemory.com/index.php/repo/baronha/react-native-multiple-image-picker/issues/52

    Login or Signup to reply.
  2. try the below provided solution.

    Add this section in app level build.gradle file in android {} section

     configurations {
        all*.exclude module: 'ucrop' // This removes all other versions of `ucrop` if gets duplicated from all the artifacts.
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search