react-native-image-crop-picker: Failed to resolve: com.github.yalantis:ucrop:2.2.2-native

Version

Tell us which versions you are using:

  • react-native-image-crop-picker v0.21.2
  • react-native v0.56.0

Platform

Tell us to which platform this issue is related

  • Android

Expected behaviour

build android without error

Actual behaviour

FAILURE: Build failed with an exception.

  • What went wrong: Could not resolve all files for configuration ‘:app:debugCompileClasspath’.

Could not resolve com.github.yalantis:ucrop:2.2.2-native. Required by: project :app > project :react-native-image-crop-picker Could not resolve com.github.yalantis:ucrop:2.2.2-native. Could not get resource ‘https://jcenter.bintray.com/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.pom’. Could not HEAD ‘https://jcenter.bintray.com/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.pom’. java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty Could not resolve com.github.yalantis:ucrop:2.2.2-native. Could not get resource ‘https://maven.google.com/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.pom’. Could not HEAD ‘https://maven.google.com/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.pom’. java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

Steps to reproduce

  1. My android -> build.gradle
buildscript {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'

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

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
}

ext {
    buildToolsVersion = "26.0.2"
    minSdkVersion = 16
    compileSdkVersion = 26
    targetSdkVersion = 26
    supportLibVersion = "26.1.0"
}
  1. react-native run-android

Attachments

// stacktrace or any other useful debug info

Love react-native-image-crop-picker? Please consider supporting our collective: 👉 https://opencollective.com/react-native-image-crop-picker/donate

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 5
  • Comments: 16

Most upvoted comments

what i was doing wrong is putting both of these

maven { url 'https://maven.google.com' }
maven { url "https://jitpack.io" }

in buildscript instead of allprojects

@Ann1995 If you read at the “Post-install” steps on the readme. You need to add this to your build.gradle

maven { url “https://jitpack.io” }

i added maven { url “https://jitpack.io” } in allproject repo… it solved the problem allprojects { repositories { google() jcenter() maven { url “https://jitpack.io” } } }

Well, for some reason putting the minSdk to 16 instead of 21 and arranging maven like this, did the trick. Also I added “www.” just in case, well. ¯_(ツ)_/¯

allprojects {
  repositories {
    google()
    jcenter()
    maven { url 'https://www.jitpack.io' }
    mavenLocal()
    maven {
      // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
      url("$rootDir/../node_modules/react-native/android")
    }
    maven {
      // Android JSC is installed from npm
      url("$rootDir/../node_modules/jsc-android/dist")
    }
  }
}

Thanks for your help!

yes removing www worked

Just in case anyone else runs into the same problem I had…this was the error that surfaced for me when jitpack.io was experiencing downtime. If you’ve tried everything else and still nothing, check that you can reach https://jitpack.io. Once they came back up, my build started working again.

adding www to maven { url ‘https://www.jitpack.io’ } solved for me too after hours of frustration

Are you using RN 0.59?

because in my case it is not solving my problem but creating another problem

Task :@react-native-community_viewpager:compileDebugJavaWithJavac FAILED