本文介绍了摇篮找不到Android插件类路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我收到此错误说它不能找到相关的Android插件的类路径。使用1.2的gradle
这里是错误:
找不到方法的类路径()为参数[org.gradle.api.plugins:gradle这个-Android的插件:1.2.1]
这是我的的build.gradle
文件
//设置外部依赖插件,我们将用它来建立一个Android应用程序
buildscript {
库{
mavenCentral()
行家{
网址https://oss.sonatype.org/content/repositories/snapshots
}
} 依赖{
类路径'org.gradle.api.plugins:gradle这个-Android的插件:1.2.1
}
}//适用于Eclipse插件
应用插件:日蚀//适用于Android插件
应用插件:'机器人'应用插件:'行家'任务你好<< {
字符串值='wagwan
的println世界,你好! + value.toUpperCase()
}
感谢
编辑:新的错误我现在收到:
故障:建立失败,一个例外。* 什么地方出了错:
无法解析配置所有的依赖:类路径。
>无法解析组:org.gradle.api.plugins,模块:gradle这个-Android的插件,版本:1.2.1。
要求:
:RssUnified:不详
>无法获取'http://repo1.maven.org/maven2/org/gradle/api/plugins/gradle-android-plugin/1.2.1/gradle-android-plugin-1.2.1.pom'.
>无法获取'https://oss.sonatype.org/content/repositories/snapshots/org/gradle/api/plugins/gradle-android-plugin/1.2.1/gradle-android-plugin-1.2.1.pom'.*尝试:
与--stacktrace选项获取堆栈跟踪运行。与--info或--debug选项来运行,以获得更多的日志输出。
解决方案
由于指南中显示,在 {相关性类路径...}
块里面去 buildscript {...}
。仅用于构建脚本,一个名为配置的classpath
定义。
i am getting this error saying it cant find the classpath related to a android plugin. using gradle 1.2 .
here is the error:
Could not find method classpath() for arguments [org.gradle.api.plugins:gradle-android-plugin:1.2.1]
here is my build.gradle
file
//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()
}
Thanks
edit: new error i recieve now:
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.
解决方案
As shown in the guide, the dependencies { classpath ... }
block has to go inside buildscript { ... }
. Only for the build script, a configuration named classpath
is defined.
这篇关于摇篮找不到Android插件类路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!