Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot get the value of write-only property 'runProguard' with Gradle plugin 0.14.0 and Android Studio 0.9.0

After downloading Android Studio 0.9.0 and after having it update the Gradle plugin to 0.14.0 I keep getting the following error whenever I try to build:

Error:Cannot get the value of write-only property 'runProguard'

Below is the buildTypes from my Build.gradle. I've tried deleting all of the proguard related lines and resyncing but nothing works. How can I get this error to go away?

buildTypes {
    release {
        debuggable false
        signingConfig signingConfigs.release
        //runProguard true
        //proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
    debug {
        debuggable true
        signingConfig signingConfigs.debug
        //runProguard false
        //proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}
like image 608
MrEngineer13 Avatar asked Oct 31 '14 18:10

MrEngineer13


People also ask

How do I sync Gradle with Android Studio?

Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.

Where is Gradle settings in Android Studio?

Open your project in Android Studio and select File > Settings... > Build, Execution, Deployment > Build Tools > Gradle (Android Studio > Preferences... > Build, Execution, Deployment > Build Tools > Gradle on a Mac).

Why does Gradle Sync Fail?

In some cases when your Gradle files are deleted or corrupted you will not be able to download new Gradle files in android studio. In this case, we have to delete the Gradle files which are present already and then again sync your project to download our Gradle files again.

How do I get the current build type in Gradle?

all { Task task -> if (task.name == "preDebugBuild") { doFirst { //for debug build } } else if (task.name == "preReleaseBuild") { doFirst { //for release build } } } dependencies { ... } Be aware, the code that you put inside will not be executed when you change the build variant, but when you build app.


2 Answers

Apparently it was a problem with the Crashlytics/Fabric plugin. Update to version 1.14.3 in your dependencies classpath and it should work.

Source: https://plus.google.com/+AndroidDevelopers/posts/gvBK7fkYsR7

like image 110
Afzal N Avatar answered Oct 24 '22 09:10

Afzal N


You don't need to update to Fabric if you don't want, just update your crashlytics version to 1.14.3:

buildscript {
    repositories {
        maven { url 'http://download.crashlytics.com/maven' }
    }

    dependencies {
        classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.14.3'
    }
}
like image 27
PaNaVTEC Avatar answered Oct 24 '22 08:10

PaNaVTEC