持久搜索不在Gradle中导入

时间:2015-11-29 02:18:57

标签: android android-studio

我正在寻找GitHub中的持久搜索,然后我找到了这个。

GitHub Persistent Search
但是我在将它导入我的项目时遇到了麻烦。

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>

我还把它包括在我的Project 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 个答案:

答案 0 :(得分:3)

您将Sonatype Snapshots repo放在错误的位置 - 您现在拥有的那个是搜索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
}