我正在使用Android 1.0.0。我正在尝试添加蝴蝶刀的依赖项。
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.jakewharton:butterknife:6.0.0'
compile 'com.google.android.gms:play-services:6.1.11'
compile 'com.android.support:recyclerview-v7:21.0.2'
}但是我得到了下面的Gradle错误:
错误:找不到:com.jakewharton:蝴蝶刀:6.0.0
发布于 2015-01-15 13:54:21
我补充说,在三条线以下,它被修好了。谢谢大家。
repositories {
mavenCentral()
}发布于 2014-12-30 21:35:58
我也有同样的问题!最后,当我试图清理项目时,我得到了更具体的gradle错误:没有缓存版本的com.jakewharton:pat刀:6.0.0可用于脱机模式。所以问题是启用了gradle离线模式!您所需要做的就是取消设置-> Gradle ->脱机工作.
发布于 2014-12-15 18:38:49
我试过在我的build.gradle,它工作。
在根 build.gradle中。您可以尝试将repositories { mavenCentral() }放在构建脚本之外,然后它就可以工作了。
编辑
app中的build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.2'
compile 'com.jakewharton:butterknife:6.0.0'
}根中build.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.0.0-rc4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}settings.gradle
include ':app'https://stackoverflow.com/questions/27490673
复制相似问题