错误:(23,20)无法解决:com.github.chrisbanes:PhotoView:2.1

时间:2018-01-11 10:24:02

标签: android

我想使用PhotoView来放大android https://github.com/chrisbanes/PhotoView 但我收到以下错误

dependencies {
    implementation 'com.github.chrisbanes:PhotoView:2.1.3 '//zoom
    implementation 'com.android.support:support-v4:26.0.2 '
}

根级 build.gradle

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

2 个答案:

答案 0 :(得分:5)

请确保,您已在根级 build.gradle 部分添加了此内容。

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

之后, Clean-Rebuild-Run

<强>演示

buildscript {

    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'

    }
}

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

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

答案 1 :(得分:0)

尝试使用之前的依赖版本编译,如

implementation 'com.github.chrisbanes:PhotoView:2.0.0'

清理项目并重建。