我更新我的gradle從1.6到1.8來構建我的Android應用程序。但不管我用gradle
還是gradle clean
gradle都會掛在'> Loading > Resolving dependencies ':lib/actionbarsherlock:classpath''
更重要的是,一切都適合gradle 1.6。
我的build.gradle低於:
根的build.gradle:Gradle 1.8掛起解決Android的依賴關係,但1.6正常
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5+'
}
}
allprojects {
repositories {
maven {
url "http://maven.oschina.net/content/groups/public"
}
}
}
setting.gradle:
include 'lib/library1'
include 'lib/actionbarsherlock'
include 'lib/library'
include 'qingdaobus160'
actionbarsherlock的的build.gradle:
buildscript {
repositories {
maven {
url "http://maven.oschina.net/content/groups/public"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6+'
}
}
apply plugin: 'android-library'
dependencies {
compile files('libs/android-support-v4.jar')
}
android {
compileSdkVersion 18
buildToolsVersion "18.0.1"
sourceSets {
main {
manifest {
srcFile 'AndroidManifest.xml'
}
java {
srcDir 'src'
}
res {
srcDir 'res'
}
assets {
srcDir 'assets'
}
resources {
srcDir 'src'
}
aidl {
srcDir 'src'
}
}
}
}
和主要項目:
buildscript {
repositories {
maven {
url "http://maven.oschina.net/content/groups/public"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
android {
compileSdkVersion 18
buildToolsVersion "18.0.1"
dependencies {
compile project(":lib/actionbarsherlock")
compile project(":lib/library")
compile project(":lib/library1")
compile fileTree(dir: 'libs', include: '*.jar')
}
sourceSets {
main {
manifest {
srcFile 'AndroidManifest.xml'
}
java {
srcDir 'src'
}
res {
srcDir 'res'
}
assets {
srcDir 'assets'
}
resources {
srcDir 'src'
}
aidl {
srcDir 'src'
}
}
}
}
tasks.withType(Compile) {
options.encoding = "UTF-8"
}
task copyNativeLibs(type: Copy) {
from fileTree(dir: 'libs', include: '**/*.so') into 'build/native-libs'
}
tasks.withType(Compile) { compileTask -> compileTask.dependsOn copyNativeLibs }
clean.dependsOn 'cleanCopyNativeLibs'
tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask ->
pkgTask.jniDir file('build/native-libs')
}