【解决方法】No signature of method: build 编译错误的方法
编译出错信息如下所示
A problem occurred evaluating project ':app'.
No signature of method: build_5woso1t2zz3j65kzgsuf20yp6.android() is applicable for argument types: (build_5woso1t2zz3j65kzgsuf20yp6$_run_closure1) values: [build_5woso1t2zz3j65kzgsuf20yp6$_run_closure1@36ae71c4]
原因分析
从错误信息来看,其实是说你的build.gradle 脚本内容错误,一般是在各个闭包中,添加了不正确的已知闭包实现。
例如 android{} 闭包中增加大小写不正确的 DefaultConfig 等。
解决措施
检查最近添加到build.gradle脚本,
- 是否添加的层次结构不正确, 例如 ndk 应该在 defaultConfig 闭包中
- 是否有大小写不正确的,拼写错误的,例如 defaultConfig 写成 DefaultConfig.