Could not find method runProguard问题解决

1. 问题描述:

在导入一个新的项目时,编译报错如下:

“Error:(16, 0) Could not find method runProguard() for arguments [false] on BuildType_Decorated{name=release, debuggable=false, testCoverageEnabled=false, jniDebuggable=false, pseudoLocalesEnabled=false, renderscriptDebuggable=false, renderscriptOptimLevel=3, minifyEnabled=false, zipAlignEnabled=true, signingConfig=null, embedMicroApp=true, mBuildConfigFields={}, mResValues={}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}} of type com.android.build.gradle.internal.dsl.BuildType.”


2. 问题分析与解决:

显然,runProguard是错误所在。在分析了build.gradle文件后,发现确实指定了为false,去掉这个指定即可。如下:

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

你可能感兴趣的:(Could not find method runProguard问题解决)