解析失败:com.github.ozodrukh:CircularReveal:1.1.0

Failed to resolve: com.github.ozodrukh:CircularReveal:1.1.0

我正在尝试通过以下方式将此库 (https://github.com/ozodrukh/CircularReveal) 导入到我的项目中:compile 'com.github.ozodrukh:CircularReveal:1.1.0@aar'

但是我得到这个错误:

Error:(25, 13) Failed to resolve: com.github.ozodrukh:CircularReveal:1.1.0
<a href="openFile">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>

我不明白为什么我用这种方法导入其他库就成功了。

在存储库的 Github 页面上:

This library is not released in Maven Central, but instead you can use JitPack. Add remote maven url:

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

您是否可能忘记将此添加到您的 gradle 文件中?

您应该先添加存储库,然后在您的 build.gradle(app:module) 中添加依赖项,就像这样:

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

}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.android.support:support-v4:24.2.1'
    compile ('com.github.ozodrukh:CircularReveal:2.0.1@aar') {
        transitive = true;
    }
}

好的,你可以的,希望对你有帮助!