Android的工作室:插件ID为“Android的库'未找到 [英] Android Studio: Plugin with id 'android-library' not found
问题描述
我一直试图让ActionBarSherlock工作,有一些问题。试图建立它的时候有一个问题我已经遇到如下消息:
I've been trying to get ActionBarSherlock to work and having some issue. One issue I've come across is the following message when trying to build it:
Plugin with id 'android-library' not found
具体做法是:
D:\Projects\Android\actionbarsherlock>D:\Projects\Android\gradlew --info build
Starting Build
Settings evaluated using empty settings script.
Projects loaded. Root project using build file
'D:\Projects\Android\actionbarsherlock\build.gradle'.
Included projects: [root project 'actionbarsherlock']
Evaluating root project 'actionbarsherlock' using build file
'D:\Projects\Android\actionbarsherlock\build.gradle'.
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\Projects\Android\actionbarsherlock\build.gradle' line: 1
* What went wrong:
A problem occurred evaluating root project 'actionbarsherlock'.
> Plugin with id 'android-library' not found.
我这当作一个单独的线程的ABS问题,所以在这里我很好奇如何解决的普遍问题:
I'm treating this as an ABS issue in a seperate thread, so here I'm curious how to address the general issue of:
Plugin with id 'android-library' not found
下面是的build.gradle:
Here is the build.gradle:
apply plugin: 'android-library'
dependencies {
compile 'com.android.support:support-v4:18.0.+'
}
android {
compileSdkVersion 14
buildToolsVersion '17.0.0'
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
您能帮我吗?
推荐答案
指示摇篮,从中央Maven的存储库下载Android插件。
Instruct Gradle to download Android plugin from Maven Central repository.
您通过粘贴以下code。在摇篮中开始构建文件做到这一点:
You do it by pasting the following code at the beginning of the Gradle build file:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.1'
}
}
替换版本字符串 1.0 +
的最新版本。摇篮插件发布的版本可在<一找到href=\"http://search.maven.org/#search%7Cga%7C1%7Cg:%22com.android.tools.build%22%20AND%20a:%22gradle%22\">official Maven仓库或在 MVNRepository神器搜索。
Replace version string 1.0.+
with the latest version. Released versions of Gradle plugin can be found in official Maven Repository or on MVNRepository artifact search.
这篇关于Android的工作室:插件ID为“Android的库'未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!