我已经从 Gradle 0.8 更新到 0.9,但它给我带来了不兼容的问题。我已尝试修复它,但我不知道问题出在哪里。
非常感谢您的帮助。这是我的 Gradle 文件 :) 谢谢!
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion '19.0.1'
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
dependencies {
compile 'com.fasterxml.jackson.core:jackson-databind:2.2.+'
compile 'com.fasterxml.jackson.core:jackson-core:2.2.+'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.2.+'
compile 'commons-lang:commons-lang:2.6'
compile 'com.nhaarman.listviewanimations:library:2.5.2'
compile files('libs/TestFlightLib.jar')
compile 'com.android.support:support-v4:19.0.1'
}
android {
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
编辑:
错误是这样的:
Failed to refresh Gradle project 'gradle'
Unable to load class 'org.gradle.api.artifacts.result.ResolvedComponentResult'.
This is an unexpected error. Please file a bug containing the idea.log file.
最佳答案
好的,我修好了。看书的人,问题出在你身上
gradle/wrapper/gradle-wrapper.properties
文件。该文件应与此类似:
#Fri Mar 07 11:15:20 CET 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip
特别是,您需要 gradle-1.10 而不是 gradle-1.9
如果您没有此文件(我就是这种情况),只需创建它并重建项目即可。如果仍然存在错误,请清理项目并重新构建。
关于android - 从 gradle 0.8 更新到 0.9,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22246646/