English 中文(简体)
在安乐斯发现问题的重复班
原标题:Duplicate class found issue in Android

这是一个共同的问题,它多次被问及不同的受抚养人,我用所提供的解决办法进行审判,但其中没有办法工作,而且仍然有同样的错误。

它是本土反应项目,在为安乐公司进行汇编时,它留下以下错误:

Duplicate class com.canhub.cropper.BitmapCroppingWorkerJob found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.BitmapCroppingWorkerJob$Result found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.BitmapCroppingWorkerJob$onPostExecute$2 found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.BitmapCroppingWorkerJob$start$1 found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.BitmapCroppingWorkerJob$start$1$1 found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.BitmapLoadingWorkerJob found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.BitmapLoadingWorkerJob$Result found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.BitmapLoadingWorkerJob$onPostExecute$2 found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.BitmapLoadingWorkerJob$start$1 found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.BitmapUtils found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.BitmapUtils$BitmapSampled found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.BitmapUtils$RotateBitmapResult found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.BitmapUtils$WhenMappings found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropException found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropException$Cancellation found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropException$Companion found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropException$FailedToDecodeImage found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropException$FailedToLoadBitmap found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropFileProvider found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImage found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImage$ActivityResult found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImage$ActivityResult$Companion found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImage$ActivityResult$Companion$CREATOR$1 found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImage$CancelledResult found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageActivity found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageActivity$Companion found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageActivity$Source found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageActivity$WhenMappings found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageActivity$onCreate$1 found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageActivity$showIntentChooser$ciIntentChooser$1 found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageAnimation found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageContract found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageContractOptions found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageIntentChooser found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageIntentChooser$Companion found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageIntentChooser$ResultCallback found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageOptions found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageOptionsKt found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageView found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageView$Companion found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageView$CropCornerShape found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageView$CropResult found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageView$CropShape found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageView$Guidelines found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageView$OnCropImageCompleteListener found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageView$OnSetCropOverlayMovedListener found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageView$OnSetCropOverlayReleasedListener found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageView$OnSetCropWindowChangeListener found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageView$OnSetImageUriCompleteListener found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageView$RequestSizeOptions found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropImageView$ScaleType found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropOverlayView found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropOverlayView$Companion found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropOverlayView$CropWindowChangeListener found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropOverlayView$ScaleListener found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropOverlayView$WhenMappings found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropWindowHandler found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropWindowHandler$WhenMappings found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropWindowMoveHandler found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropWindowMoveHandler$Companion found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropWindowMoveHandler$Type found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.CropWindowMoveHandler$WhenMappings found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.databinding.CropImageActivityBinding found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.databinding.CropImageViewBinding found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.utils.GetFilePathFromUriKt found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)
Duplicate class com.canhub.cropper.utils.GetUriForFileKt found in modules jetified-Android-Image-Cropper-4.3.1-runtime (com.github.CanHub:Android-Image-Cropper:4.3.1) and jetified-android-image-cropper-4.5.0-runtime (com.vanniktech:android-image-cropper:4.5.0)

我尝试增加以下人员,但没有工作。

Force to use com.vanniktech:android-image-cropper:4.5.0, not work.

configurations {
    all {
        resolutionStrategy {
            force  com.vanniktech:android-image-cropper:4.5.0 
        }
    }
}

不包括:Android-Image-Cropper, 不工作

implementation( com.github.CanHub:Android-Image-Cropper:4.3.1 ) {
    exclude group:  com.github.CanHub , module:  Android-Image-Cropper 
}

Constraint to com.vanniktech:android-image-cropper:4.5.0, not work.

constraints {
    implementation("com.vanniktech:android-image-cropper:4.5.0") {
        because("android-image-cropper is already in com.vanniktech:android-image-cropper")
    }
}
问题回答

Adding configurations all to exclude the lib like the following in build.gradle (:app) resolved the issue.

android {
    ...
    configurations {
        all {
            exclude group:  com.github.CanHub , module:  Android-Image-Cropper 
        }
    }
}




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签