Failed to resolve com.github.chrisbanes: PhotoView: 1.3.1

I am using photoview from this library com.github.chrisbanes:PhotoView:1.3.1. But my Gradle is not syncing.

error

gradle file

I already added Maven code from Gradle Dependence on this URL: https://github.com/chrisbanes/PhotoView

+4
source share
2 answers

I had this problem and solved it by adding a repository to buildscript. Here you can see my build.gradle (not a module, but a project one):

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

buildscript {
    repositories {
        maven { url "https://jitpack.io" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

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

I don’t know why I need this, because a friend of mine just added a repository to the allprojects block, and it works for him.

+5
source
0

Source: https://habr.com/ru/post/1664404/


All Articles