无法在 Android 工作室中添加 ozodrukh 的 CircularReveal 库

Cannot add CircularReveal library by ozodrukh in Android studio

我正在使用 Android Studio 1.1.0 并尝试添加 CircularReveal 库。我已按照此处提到的说明进行操作。

我的 build.gradle(Module: app) 是:

 apply plugin: 'com.android.application'

    android {
        compileSdkVersion 21
        buildToolsVersion "21.1.1"

        defaultConfig {
            applicationId "com.geronimo.myapplication"
            minSdkVersion 18
            targetSdkVersion 21
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:appcompat-v7:21.0.3'
        compile 'com.github.ozodrukh:CircularReveal:(latest-release)@aar'
    }

I have added the repository in `build.gradle(Project: MyApplication3)`

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

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

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.0'

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

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

我收到的错误是

 D:\Workspaces\AndroidStudio\Studio1.0\MyApplication3\app\build.gradle
Error:(24, 13) Failed to resolve: com.github.ozodrukh:CircularReveal:(latest-release)
    <a href="openFile">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>

我也尝试过依赖的变体,即:

compile 'com.github.ozodrukh:CircularReveal:(latest-release)@aar' 
compile 'com.github.ozodrukh:CircularReveal:(v1.0.4)@aar' 
compile 'com.github.ozodrukh:CircularReveal-v1.0.4 @aar'

错误始终保持为Failed to resolve...

是否有任何其他方法可以导入远程 aar 文件并添加此依赖项?

手动将 @aar 文件复制到 libs 目录。然后前往

Files>Project Structure>Dependency

右边的红十字上选择library dependency。这将提示您一个对话框,您可以在其中搜索您的依赖项并添加它们。

从 github 下载 circularReveal library 并将其作为 Module DependencyFiles>Project Structure>Dependency

导入

您只需要输入不带括号的版本号和 'v' 字符 com.github.ozodrukh:CircularReveal:1.0.4@aar

我之前遇到过同样的问题。我查了一下,是miniSDK版本低于15的问题,改成15后就可以了。

minSdkVersion 14(改为15以上) targetSdkVersion 26

然后将其粘贴到您的库依赖项中

implementation ('com.github.ozodrukh:CircularReveal:2.0.1@aar') { transitive = true; }

同时添加远程mavenurl

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