After upgrading to Android Studio 1.2, I get the following error when trying to sync my project
Error: Unable to load class' Com.android.build.gradle.internal.tasks.OutputFileTask. Possible causes of this unexpected error include:
- Gradle dependency cache may be damaged (this sometimes happens after a network connection timeout.) Reloading dependencies and project synchronization (network required)
- The build state of the Gradle process (daemon) may be corrupted. Stopping all Gradle daemons can solve this problem. Stop Gradle processes (restart required)
In case of damage to Gradle processes, you can also try to close the IDE and then kill all Java processes.
This is my gradle file.
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 } } } } }
I think there might be another Gradle api change, which is why the old stuff no longer works.
How can I solve the problem to re-create the project?
android android-studio android-gradle gradle
Marian klühspies
source share