无法同步 Gradle,找不到 com.android.support:support-annotations:23.3.0
Failed to Sync Gradle, could not find com.android.support:support-annotations:23.3.0
安装 Butter Knife 依赖项会产生此错误
Error:Could not find com.android.support:support-annotations:23.3.0.
Required by:
Butter:app:unspecified
Butter:app:unspecified > com.jakewharton:butterknife:8.0.1
Butter:app:unspecified > com.jakewharton:butterknife-compiler:8.0.1 > com.jakewharton:butterknife-annotations:8.0.1
Please install the Android Support Repository from the Android SDK Manager.
<a href="openAndroidSdkManager">Open Android SDK Manager</a>
我已经安装了支持库,但仍然出现此错误。这是 Gradle 依赖项的样子
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:support-annotations:23.3.0'
compile 'com.jakewharton:butterknife:8.0.1'
apt 'com.jakewharton:butterknife-compiler:8.0.1'
}
我还添加了插件 apply plugin: 'com.neenbedankt.android-apt'
和存储库
jcenter()
mavenCentral()
maven{
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
在 SDK 管理器中更新您的 Google 存储库
将以下内容添加到您的 build.gradle 文件中:
configurations.all {
resolutionStrategy {
force 'com.android.support:support-annotations:23.3.0'
}
}
更新Android 支持存储库。
一种解决方案是在 build.gradle(模块:app)中用 "compileOnly" 替换 "provided"。
安装 Butter Knife 依赖项会产生此错误
Error:Could not find com.android.support:support-annotations:23.3.0.
Required by:
Butter:app:unspecified
Butter:app:unspecified > com.jakewharton:butterknife:8.0.1
Butter:app:unspecified > com.jakewharton:butterknife-compiler:8.0.1 > com.jakewharton:butterknife-annotations:8.0.1
Please install the Android Support Repository from the Android SDK Manager.
<a href="openAndroidSdkManager">Open Android SDK Manager</a>
我已经安装了支持库,但仍然出现此错误。这是 Gradle 依赖项的样子
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:support-annotations:23.3.0'
compile 'com.jakewharton:butterknife:8.0.1'
apt 'com.jakewharton:butterknife-compiler:8.0.1'
}
我还添加了插件 apply plugin: 'com.neenbedankt.android-apt'
和存储库
jcenter()
mavenCentral()
maven{
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
在 SDK 管理器中更新您的 Google 存储库
将以下内容添加到您的 build.gradle 文件中:
configurations.all {
resolutionStrategy {
force 'com.android.support:support-annotations:23.3.0'
}
}
更新Android 支持存储库。
一种解决方案是在 build.gradle(模块:app)中用 "compileOnly" 替换 "provided"。