gpt4 book ai didi

android - 无法使用 Android Studio 1.2 和 Gradle 1.2.2 加载类 OutputFileTask

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:02:17 25 4
gpt4 key购买 nike

升级到 Android Studio 1.2 后,我在尝试同步我的项目时遇到以下错误

Error:Unable to load class 'com.android.build.gradle.internal.tasks.OutputFileTask'. Possible causes for this unexpected error include:

  • Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network)
  • The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build processes (requires restart)
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

这是我的gradle文件

apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'maven-publish'

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

repositories {
mavenCentral()
}

defaultConfig {
minSdkVersion 9
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
consumerProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

lintOptions {
abortOnError false
checkReleaseBuilds false
}

packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LGPL2.1'
}
}


dependencies {
compile 'com.android.support:support-v4:22.1.0'
compile 'com.android.support:appcompat-v7:22.1.0'
}

task sourceJar(type: Jar) {
classifier "source"
}



publishing {
publications {

repositories.maven {
url repo
credentials {
username user
password passwd
}
}

maven(MavenPublication) {
artifacts {
groupId 'com.android'
artifactId 'artefact-1'
version '1'
artifact artifactPath
}
}
}

}

}

我认为可能还有另一个 gradle api 更改导致旧的东西不再工作。

如何解决问题以重新构建我的项目?

最佳答案

您在使用 dexguard 吗?我有一个旧的 dexguard 版本的问题。自从我更新到 6.1.19 就没有问题了。 (目前使用 AS 1.2.1 & Gradle 2.4 & 1.2.3)

关于android - 无法使用 Android Studio 1.2 和 Gradle 1.2.2 加载类 OutputFileTask,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30017476/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com