Android构建无法添加外部库

时间:2015-12-17 19:07:58

标签: android github build.gradle

我正在尝试在我的项目中包含一个库,根据github上的说明,我在build.gradle文件中包含以下内容:

compile 'com.github.omadahealth.slidepager: slidepager: 2.2.4@aar'

但我明白了 error

顶级构建文件

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

        // 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
}

模块:app构建文件

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.example.exampleapp"
        minSdkVersion 14
        targetSdkVersion 23
        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:23.1.1'
    compile 'com.android.support:support-v4:23.1.1'
    compile 'com.android.support:recyclerview-v7:23.1.1'
    compile 'com.android.support:palette-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.github.omadahealth.slidepager:slidepager:2.2.4@aar'
}

1 个答案:

答案 0 :(得分:0)

他们使用其他库,如果你添加

,他们会使用其他库依赖项
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.easing:library:1.0.1@aar'
compile 'com.github.orangegangsters:library:1.3.4@aar'
compile 'com.github.omadahealth.slidepager:slidepager:2.2.4@aar'

你得到一个Error:(91, 21) No resource found that matches the given name: attr 'tv_typeface'

我试着下载它们并将它们添加到库gradle中?