[android]不导入在 Gradle 的持续搜索

发布时间: 2016/9/25 20:12:36
注意事项: 本文中文内容可能为机器翻译,如要查看英文原文请点击上面连接.

我要寻找持续搜索在 GitHub 然后我发现这。

GitHub 的持续搜索
但我有问题,将它导入到我的项目。

apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
    compileSdkVersion 22
    buildToolsVersion "21.1.2"

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

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.android.support:design:22.2.1'
    compile "com.raizlabs.android:DBFlow-Core:2.2.1"
    compile "com.raizlabs.android:DBFlow:2.2.1"
    apt 'com.raizlabs.android:DBFlow-Compiler:2.2.1'    
    compile 'com.quinny898.library.persistentsearch:library:1.1.0-SNAPSHOT'
}

当导入,我得到了此错误。

Error:Could not find com.quinny898.library.persistentsearch:library:1.1.0-SNAPSHOT.
Required by:
    JuanDirection:app:unspecified
<a href="searchInBuildFiles">Search in build.gradle files</a>

我也包括这对我的项目 Gradle。

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

buildscript {
    repositories {
        jcenter()
        maven {
            url "https://oss.sonatype.org/content/repositories/snapshots"
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'

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

allprojects {
    repositories {
        jcenter()
    }
}

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

解决方法 1:

Sonatype 快照回购放错了地方 — — 你现在有的一个正在寻找 Gradle插件,没有图书馆。

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

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'

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

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://oss.sonatype.org/content/repositories/snapshots"
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
官方微信
官方QQ群
31647020