gradle没有解析android studio中的任何新依赖项

时间:2016-09-14 05:31:39

标签: android

我正在为我的app制作一个简介。经过一些研究,我得到了一个github项目,用来制作很酷的介绍。它需要以下依赖:

compile 'com.github.paolorotolo:appintro:4.0.0'

当我用gradle编译它时,它会给我以下错误:

Failed to resolve: com.github.paolorotolo:appintro:4.0.0

我在互联网上做过一些研究,但一切都没有成功。

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

apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "24.0.1"

defaultConfig {
    applicationId "com.example.adarsh.testapp"
    minSdkVersion 16
    targetSdkVersion 24
    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:24.2.0'
compile 'com.android.support:support-v4:24.2.0'
compile 'com.github.paolorotolo:appintro:4.0.0'
}

这是我的build.gradle(project:testapp)

// 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:2.1.3'

    // 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 :(得分:0)

我只是在mavenCentral()的存储库中添加build.gradle解决了我的问题。