![](/img/trans.png)
[英]android studio clear .gradle on C:\Users\Administrator,can't find one of the classpath
[英]Gradle can't find classpath for android plugin
我收到此错误,说它无法找到与Android插件相关的类路径。 使用gradle 1.2。
这是错误:
Could not find method classpath() for arguments [org.gradle.api.plugins:gradle-android-plugin:1.2.1]
这是我的build.gradle
文件
//setup external dependency plugins we will use to build a android application
buildscript {
repositories {
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}
dependencies {
classpath 'org.gradle.api.plugins:gradle-android-plugin:1.2.1'
}
}
//apply eclipse plugin
apply plugin: 'eclipse'
//apply android plugin
apply plugin: 'android'
apply plugin: 'maven'
task hello << {
String value = 'wagwan'
println 'Hello world!' + value.toUpperCase()
}
谢谢
编辑:我现在收到的新错误:
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve group:org.gradle.api.plugins, module:gradle-android-plugin, version:1.2.1.
Required by:
:RssUnified:unspecified
> Could not GET 'http://repo1.maven.org/maven2/org/gradle/api/plugins/gradle-android-plugin/1.2.1/gradle-android-plugin-1.2.1.pom'.
> Could not GET 'https://oss.sonatype.org/content/repositories/snapshots/org/gradle/api/plugins/gradle-android-plugin/1.2.1/gradle-android-plugin-1.2.1.pom'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
如指南所示, dependencies { classpath ... }
块必须在buildscript { ... }
内部。 仅对于构建脚本,定义了名为classpath
的配置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.