编译Android工程时,如果出现类似如下的错误:
Build file '/Users/zhao/sw/workspace/myProject/app/build.gradle' line: 3
A problem occurred evaluating project ':app'.
> No signature of method: build_3iciaioon0bu97t06e9d2wjmp.android() is applicable for argument types: (build_3iciaioon0bu97t06e9d2wjmp$_run_closure1) values: [build_3iciaioon0bu97t06e9d2wjmp$_run_closure1@4e439b45]
问题一般是在build.gradle的android节点中有错误的配置,比如配置了kotlinOptions,但是没有引入kotlin-android插件。因为错误信息中没有给出详细的错误原因,所以可以逐个注释子节点进行排查。
解决Android编译错误:Nosignatureofmethod
当遇到Android工程编译错误,提示在build.gradle文件的android节点有不适用的方法调用时,可能的原因是配置了kotlinOptions但未引入kotlin-android插件。解决方法是检查并确保所有配置项与已添加的依赖匹配,或者逐个注释部分代码进行排查。
900

被折叠的 条评论
为什么被折叠?



