无法解析com.github.chrisbanes:PhotoView:1.3.1

Raj*_*iya 7 android android-gradle-plugin android-photoview

我正在使用这个图书馆的photoview com.github.chrisbanes:PhotoView:1.3.1.但是我的Gradle没有同步.

错误

gradle文件

我已经在这个网址上添加了Gradle Dependancy的Maven代码:https://github.com/chrisbanes/PhotoView

sen*_*erh 12

我有这个问题并通过在buildscript中添加存储库来解决这个问题.在这里你可以看到我的build.gradle(不是模块,而是项目):

// 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
}
Run Code Online (Sandbox Code Playgroud)

我不知道为什么我需要这样做,因为我的朋友刚刚在allprojects块中添加了存储库,它对他有用.