After Android Studio update: Gradle DSL method not found: 'runProguard()'

后端 未结 3 1012
感动是毒
感动是毒 2020-12-23 17:04

I\'ve just updated my Android Studio and now my project won\'t build anymore. I get following error:

Error:(16, 0) G         


        
相关标签:
3条回答
  • 2020-12-23 17:20

    As @stkent said, runProguard has been renamed to minifyEnabled in version 0.14.0 (2014/10/31) of Gradle.

    To fix this, you need to change runProguard to minifyEnabled in the build.gradle file of your project. For example,

    buildTypes {
        release {
            runProguard false // Does not exist anymore...
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    

    would be replaced by

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    

    You can see other issues here but this worked for me.

    0 讨论(0)
  • 2020-12-23 17:36

    runProguard has been renamed minifyEnabled. See the changelog here for confirmation - version 0.14.0 (2014/10/31) of the Android Gradle plugin made the swap.

    0 讨论(0)
  • 2020-12-23 17:36

    runProguard has been renamed to minifyEnabled in version 0.14.0 (2014/10/31) of Gradle.

    To fix this, you need to change runProguard to minifyEnabled in the build.gradle file of your project.

    0 讨论(0)
提交回复
热议问题