- Published on
Fix 'Could Not Find com.theartofdev.edmodo:android-image-cropper:2.8.0' Error
- Authors
- Name
- Ripal & Zalak
Fix 'Could Not Find com.theartofdev.edmodo:android-image-cropper:2.8.0' Error
When adding an image cropper to your Android application, you might encounter the following error while building your project:
Could not find com.theartofdev.edmodo:android-image-cropper:2.8.0
This issue arises because the original Android-Image-Cropper library is outdated and no longer available in standard repositories. Below are the steps to fix this issue and use a working alternative.
Why Does This Error Occur?
- Library is Deprecated:
com.theartofdev.edmodo:android-image-cropper
is no longer maintained. - Repository Removal: The library was previously available on jcenter(), which has been shut down.
- Incorrect Dependency Configuration: Your project might still be referencing outdated dependencies.
How to Fix the Issue
Solution 1: Use an Alternative Library
Since the original library is no longer maintained, you can use the CanHub Android-Image-Cropper, which is actively updated:
Step 1: Add JitPack Repository
Modify your root build.gradle file by adding JitPack:
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
maven { url='https://jitpack.io' }
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url='https://jitpack.io' }
}
}
Step 2: Update the Dependency
Replace the old dependency with the new version in your app-level build.gradle file:
dependencies {
implementation("com.github.CanHub:Android-Image-Cropper:4.6.0")
}
Solution 2: Use an Alternative Library
If you're still facing issues, try using another maintained image cropper library:
dependencies {
implementation 'com.vanniktech:android-image-cropper:4.6.0'
}
And update your imports accordingly:
import com.canhub.cropper.CropImageView
import com.canhub.cropper.CropImage
FAQs
1. Why was the old Image Cropper library removed?
The original com.theartofdev.edmodo:android-image-cropper
library was hosted on jcenter(), which has been shut down. As a result, the library is no longer available for download.
2. How can I fix unresolved dependencies in Gradle?
Try the following steps:
- Sync Gradle: Open Android Studio → File → Sync Project with Gradle Files.
- Invalidate Caches and Restart: File → Invalidate Caches / Restart.
- Delete and Reinstall Dependencies:
rm -rf .gradle ./gradlew clean ./gradlew build
3. Will this fix work for both Kotlin and Java?
Yes, both Kotlin and Java projects can use the updated CanHub Image Cropper library without issues.