Mar*_*ies 7 android gradle android-studio android-gradle-plugin
升级到Android Studio 1.2后,我在尝试同步项目时收到以下错误
错误:无法加载类'com.android.build.gradle.internal.tasks.OutputFileTask'.此意外错误的可能原因包括:
在损坏的Gradle进程的情况下,您还可以尝试关闭IDE,然后终止所有Java进程.
- Gradle的依赖缓存可能已损坏(这有时会在网络连接超时后发生.)重新下载依赖项并同步项目(需要网络)
- Gradle构建过程(守护程序)的状态可能已损坏.停止所有Gradle守护进程可以解决此问题.停止Gradle构建过程(需要重启)
这是我的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
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
我认为可能还有另一个gradle api更改导致旧的东西不再工作.
如何解决问题再次构建我的项目?
你用的是dexguard吗?我在使用旧的 dexguard 版本时遇到了问题。自从我更新到 6.1.19 后,就不再有问题了。(当前使用 AS 1.2.1 和 Gradle 2.4 和 1.2.3)
| 归档时间: |
|
| 查看次数: |
1170 次 |
| 最近记录: |