我正在尝试将library导入我的项目,它引发以下错误:
Error:(8, 13) Failed to resolve: com.github.manuelpeinado.fadingactionbar:fadingactionbar-abc:3.1.2 <a href="openFile">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
这是我的build.gradle:
apply plugin: 'com.android.application'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':StickyListHeaders')
compile project(':facebook')
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.android.support:support-v4:22.2.0'
compile 'com.github.manuelpeinado.fadingactionbar:fadingactionbar-abc:3.1.2'
}
这是顶级build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
}
}
错误详情:
错误:配置项目':UIAppTemplate'时发生问题。
最佳答案
在build.gradle
中,您必须添加
repositories {
jcenter()
}
这样gradle就能知道要下载的依赖项在哪里。
它与
buildscript
块中的存储库有所不同。否则,您可以添加顶级
build.gradle
文件:allprojects {
repositories {
jcenter()
}
}