ImagePicker icon indicating copy to clipboard operation
ImagePicker copied to clipboard

ucrop not found error

Open vtxmg opened this issue 3 years ago • 3 comments

Describe the bug When I run app, this error found on log and stopped running further.

8: Task failed with an exception.

  • What went wrong: Execution failed for task ':app:mergeDebugNativeLibs'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find com.github.yalantis:ucrop:2.2.7. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/github/yalantis/ucrop/2.2.7/ucrop-2.2.7.pom - https://repo.maven.apache.org/maven2/com/github/yalantis/ucrop/2.2.7/ucrop-2.2.7.pom - https://jcenter.bintray.com/com/github/yalantis/ucrop/2.2.7/ucrop-2.2.7.pom Required by: project :app > com.github.Drjacky:ImagePicker:2.1.13

To Reproduce

  1. Add Dependencies on build.gradle
  2. Click on Run
  3. See error on Log

Expected behavior Run with no issues.

Screenshots Used in MainActivity on onCreate method.

fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                ImagePicker.with(MainActivity.this)
                        .createIntent();
            }
        });

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

This is my build.gradle App

plugins {
    id 'com.android.application'
}

android {
    compileSdk 31

    defaultConfig {
        applicationId "com.example.example"
        minSdk 21
        targetSdk 31
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
    implementation 'com.airbnb.android:lottie:4.1.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

    implementation 'com.github.Drjacky:ImagePicker:2.1.13'
}

This is my build.gradle Project

buildscript {
    repositories {
        google()
        mavenCentral()
        maven { url "https://jitpack.io" }
    }
    dependencies {
        classpath "com.android.tools.build:gradle:7.0.1"
    }
}


task clean(type: Delete) {
    delete rootProject.buildDir
}

vtxmg avatar Aug 24 '21 18:08 vtxmg

Have you added this:

allprojects {
	   repositories {
	      	mavenCentral() // For ImagePicker library, this line is enough. Although, it has been published on jitpack as well
           	maven { url "https://jitpack.io" }  //Make sure to add this in your project for uCrop - an internal library
	   }
	}

https://github.com/Drjacky/ImagePicker#usage

Drjacky avatar Aug 29 '21 11:08 Drjacky

Getting same.....no luck so far....anyone any idea ?

utills avatar Dec 26 '21 13:12 utills

@utills Could you please try this solution and let me know if it helped: https://github.com/Drjacky/ImagePicker/issues/45#issuecomment-962007033

Drjacky avatar Jan 01 '22 17:01 Drjacky

I solved this issue by:

  1. Remove following block in settings.gradle
- dependencyResolutionManagement {
-   // ...
- }
  1. Adding maven { url "https://jitpack.io" } to build.gradle (Project)
allprojects {
    apply plugin: "org.jlleitschuh.gradle.ktlint"

    repositories {
        google()
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
+        maven { url "https://jitpack.io" }
    }
}

benjamin-luescher avatar Aug 20 '22 13:08 benjamin-luescher