Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to resolve: com.github.yalantis:ucrop:2.2.1 #309

Closed
sidharthanil opened this issue Jun 7, 2017 · 15 comments
Closed

Failed to resolve: com.github.yalantis:ucrop:2.2.1 #309

sidharthanil opened this issue Jun 7, 2017 · 15 comments

Comments

@sidharthanil
Copy link

sidharthanil commented Jun 7, 2017

Hi, first of all I must say this library is good and I've been using it in my java project. The problem is I'm getting the above error when I try to add it to the gradle in a Kotlin android project. Please tell me a work around for the issue

Im using Android Studio 2.3.2 with gradle version 3.3 with kotlin plugin

@doonje
Copy link

doonje commented Jun 7, 2017

hello,
Did you add "maven { url "https://jitpack.io" }" within build.gradle?

allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}

@sidharthanil
Copy link
Author

Ahhh... Im embarassed.. I really missed the major part. Sorry for that.

@sidharthanil
Copy link
Author

Oh one more thing. If I want to perform crop on two different images and to view them in two image views in the same activity how am I gonna distinguish between them. ie, Is there any way to override the "requestCode" send

@doonje
Copy link

doonje commented Jun 7, 2017

I did not understand.
Do you want

  1. multiple image views in one activity.
  2. crop each image and apply('setImageURI()') it to each ImageView?

I think the two uri are the same. (destinationUri == resultUri)
UCrop.of(sourceUri, destinationUri).... in UCrop builder pattern
Uri resultUri = UCrop.getOutput(data); in onActivityResult(...)

So think we can distinguish it through URI.

@christianlacerda
Copy link

Guys,

I do have maven { url "https://jitpack.io" } properly set but still getting Could not find com.yalantis:ucrop:2.2.1-native.

Any ideas?

Thanks!

@c0d3-ninja
Copy link

c0d3-ninja commented Oct 28, 2017

You may add maven under buildscript=> repositories, add maven correctly to all projects=>repositories
@christianlacerda

@christianlacerda
Copy link

Hey @vimalchandhru, I did that... still getting the same error =/

buildscript {
    repositories {
        jcenter()
        google()
        maven { url "https://jitpack.io" }
    }
}

allprojects {
    repositories {
        jcenter()
        google()
        maven { url "https://jitpack.io" }
    }
}

Gradle outup:

Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.yalantis:ucrop:2.2.1-native.
Searched in the following locations:
    file:/Users/christian/Library/Android/sdk/extras/m2repository/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.pom
    file:/Users/christian/Library/Android/sdk/extras/m2repository/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.jar
    file:/Users/christian/Library/Android/sdk/extras/google/m2repository/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.pom
    file:/Users/christian/Library/Android/sdk/extras/google/m2repository/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.jar
    file:/Users/christian/Library/Android/sdk/extras/android/m2repository/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.pom
    file:/Users/christian/Library/Android/sdk/extras/android/m2repository/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.jar
    file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.pom
    file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.jar
    https://jcenter.bintray.com/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.pom
    https://jcenter.bintray.com/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.jar
    https://dl.google.com/dl/android/maven2/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.pom
    https://dl.google.com/dl/android/maven2/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.jar
    https://maven.fabric.io/public/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.pom
    https://maven.fabric.io/public/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.jar
    https://jitpack.io/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.pom
    https://jitpack.io/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.jar
    https://repo1.maven.org/maven2/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.pom
    https://repo1.maven.org/maven2/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.jar

@c0d3-ninja
Copy link

@christianlacerda comile ucrop by the below
compile ('com.yalantis:ucrop:2.1.1@aar') {
transitive = true
}
and try this

@christianlacerda
Copy link

Thanks @vimalchandhru! That worked. Just wondering why though...

@Seachal
Copy link

Seachal commented Apr 18, 2018

buildscript {
repositories {
jcenter()
google()
maven { url "https://jitpack.io" }
}

dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'
    // https://inthecheesefactory.com/blog/how-to-upload-library-to-jcenter-maven-central-as-dependency/en
    // https://www.theguardian.com/technology/developer-blog/2016/dec/06/how-to-publish-an-android-library-a-mysterious-conversation
    classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
    classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
}

}

allprojects {
repositories {
jcenter()
google()
maven { url "https://jitpack.io" }
}
}

@porya74
Copy link

porya74 commented Sep 28, 2018

@vimalchandhru
How can I compile the library?
please tell me
it's necessary.

@maheshj47
Copy link

Hi
I have added jitpack in repositoryProjects and also added dependency too but still its showing
"Failed to resolve: com.github.maheshj47:ToastLibrary:Tag"

@taknikiniga
Copy link

maven { url "https://jitpack.io" }

still getting error

Could not find com.github.yalantis:ucrop:2.2.2.
Searched in the following locations:

@taknikiniga
Copy link

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
google()

   mavenCentral()
}
allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}
dependencies {
    classpath "com.android.tools.build:gradle:7.0.3"
    classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0'
    classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.5"
    classpath "com.google.dagger:hilt-android-gradle-plugin:2.38.1"
    classpath 'com.google.gms:google-services:4.3.10'


    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

buildscript {
ext.kotlin_version = '1.5.0'
}
ext {
activityVersion = '1.2.3'
appCompatVersion = '1.3.0'
constraintLayoutVersion = '2.0.4'
coreTestingVersion = '2.1.0'
coroutines = '1.5.0'
lifecycleVersion = '2.3.1'
materialVersion = '1.3.0'
roomVersion = '2.3.0'
gson = '2.9.0'
// testing
junitVersion = '4.13.2'
_glide = '4.12.0'
image_picker ='1.7.1'
espressoVersion = '3.1.0'
androidxJunitVersion = '1.1.2'
circular_image = '3.1.0'
imagePicker = '3.2.0'
moshi = '2.4.0'
retrofit = '2.9.0'
loggingInterceptor = '4.2.1'
moshi_convertor_factory = '1.12.0'
hilt_version = '2.38.1'

}

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

Getting same error : could not find

Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.yalantis:ucrop:2.2.1-native.
Searched in the following locations:
file:/Users/christian/Library/Android/sdk/extras/m2repository/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.pom
file:/Users/christian/Library/Android/sdk/extras/m2repository/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.jar
file:/Users/christian/Library/Android/sdk/extras/google/m2repository/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.pom
file:/Users/christian/Library/Android/sdk/extras/google/m2repository/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.jar
file:/Users/christian/Library/Android/sdk/extras/android/m2repository/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.pom
file:/Users/christian/Library/Android/sdk/extras/android/m2repository/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.jar
file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.pom
file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.jar
https://jcenter.bintray.com/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.pom
https://jcenter.bintray.com/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.jar
https://dl.google.com/dl/android/maven2/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.pom
https://dl.google.com/dl/android/maven2/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.jar
https://maven.fabric.io/public/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.pom
https://maven.fabric.io/public/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.jar
https://jitpack.io/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.pom
https://jitpack.io/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.jar
https://repo1.maven.org/maven2/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.pom
https://repo1.maven.org/maven2/com/yalantis/ucrop/2.2.1-native/ucrop-2.2.1-native.jar

@manishtrivedi994
Copy link

None of the above solutions worked for me. It worked for me when I increased the heap size in Android studio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants