Could not find method runProguard() for arguments [false] on BuildType_Decorated{

本文详细解析了在Android项目从Gradle 2.2版本升级后,遇到无法找到runProguard方法的问题,并提供了具体的解决步骤。通过在build.gradle文件中修改配置,成功解决了此问题。
摘要由CSDN通过智能技术生成

 

原文错误:

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, applicationIdSuffix=null, versionNameSuffix=null, minifyEnabled=false, zipAlignEnabled=true, signingConfig=null, embedMicroApp=true, mBuildConfigFields={}, mResValues={}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}}.


原因:

gradle 2.2以前使用  runProguard false

gradle 2.2以后使用  minifyEnabled false


解决办法:

在 项目(相当于Eclipse的workplace)/module(相当于Eclipse的project)/build.gradle 文件中





改为



org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method annotationProccessorOptions() for arguments [build_8iuj5ymrxpm1tyag44tudol3w$_run_closure1$_closure3$_closure6$_closure7@7f75619f] on JavaCompileOptions$AgpDecorated_Decorated{annotationProcessorOptions=AnnotationProcessorOptions$AgpDecorated_Decorated{classNames=[], arguments={}, compilerArgumentProviders=[]}} of type com.android.build.gradle.internal.dsl.JavaCompileOptions$AgpDecorated. at org.gradle.internal.metaobject.AbstractDynamicObject$CustomMissingMethodExecutionFailed.<init>(AbstractDynamicObject.java:190) at org.gradle.internal.metaobject.AbstractDynamicObject.methodMissingException(AbstractDynamicObject.java:184) at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:80) at build_8iuj5ymrxpm1tyag44tudol3w$_run_closure1$_closure3$_closure6.doCall(D:\programTest\myAndroidProgram\MyTest\app\chpter06\build.gradle:18) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.gradle.util.internal.ClosureBackedAction.execute(ClosureBackedAction.java:73) at org.gradle.util.internal.ConfigureUtil.configureTarget(ConfigureUtil.java:155) at org.gradle.util.internal.ConfigureUtil.configure(ConfigureUtil.java:106) at org.gradle.util.internal.ConfigureUtil$WrappedConfigureAction.execute(ConfigureUtil.java:167) at com.android.build.gradle.internal.dsl.DefaultConfig$AgpDecorated.javaCompileOptions(Unknown Source) at com.android.build.gradle.internal.dsl.DefaultConfig$AgpDecorated_Decorated.javaCompileOptions(Unknown Source)
07-13
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值