问题描述
我是 android studio 的新手,当我同步 android 应用程序时出现错误.
I am new in android studio, when i sync android application i got error.
C:\Users\Mansukh\Desktop\layout\MaterialDesignLibrary-master\MaterialDesign\build.gradle
Error:(97, 0) Cannot call getBootClasspath() before setTargetInfo() is called.
请任何人告诉我错误是什么意思以及此错误的解决方案是什么.我试图在互联网上找出问题,但我无法得到特定的解决方案.
Please anyone tell me what is error mean and what are the solution for this error. i try to find out problem on internet but i unable to got particular solution.
这是我的 gradle.build 文件.
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
android {
compileSdkVersion 19
buildToolsVersion '20.0.0'
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
androidTest.setRoot('tests')
}
defaultConfig {
minSdkVersion 8
targetSdkVersion 21
versionCode 6
versionName '1.4'
}
}
ext.siteUrl = 'https://github.com/navasmdc/MaterialDesignLibrary'
ext.issueUrl = 'https://github.com/navasmdc/MaterialDesignLibrary/issues'
ext.gitUrl = 'https://github.com/navasmdc/MaterialDesignLibrary.git'
bintray {
user = hasProperty('BINTRAY_USER') ? BINTRAY_USER : "navasmdc"
key = hasProperty('BINTRAY_KEY') ? BINTRAY_PASSWORD : ""
configurations = ["archives"]
pkg {
repo = 'maven'
name = 'MaterialDesignLibrary'
desc = 'This is a library with components of Android L to you use in android 2.2'
websiteUrl = siteUrl
issueTrackerUrl = issueUrl
vcsUrl = gitUrl
licenses = ['Apache-2.0']
labels = []
publicDownloadNumbers = true
}
}
dependencies {
compile 'com.nineoldandroids:library:2.4.+'
compile 'com.android.support:support-v4:21.+'
}
install {
repositories.mavenInstaller {
pom {
project {
packaging 'aar'
name 'MaterialDesignLibrary'
url siteUrl
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'navasmdc'
name 'Iván Navas'
email '[email protected]'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}
task findConventions << {
println project.getConvention()
}
推荐答案
这是 Gradle 1.1.0 插件中的一个错误,如下所述:问题 152811.修复已经发布
This a bug in Gradle 1.1.0 plugin as described here: Issue 152811. Fix is already released
解决方案是将插件版本更改为 1.1.1 或更高版本(当前可用版本为 1.1.2).classpath 'com.android.tools.build:gradle:1.1.2'
Solution is to change plugin version to 1.1.1 or higher (currently available version is 1.1.2).classpath 'com.android.tools.build:gradle:1.1.2'
更新
还有另一个类似的错误 Android Gradle Plugin 1.1.0 中断 Javadoc 任务 1.2.2 版本修复.
There is another similar bug Android Gradle Plugin 1.1.0 breaks Javadoc tasks which is fixed in 1.2.2 version.
这篇关于在调用 setTargetInfo() 之前不能调用 getBootClasspath()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!