由于pubspec.lock文件是本地生成的,其他项目组的小伙伴将这个文件提交上来了,每次提交代码都会提示冲突,然后就删除了这个文件
第一天做了很多功能提交后,没有发现任何异常,但是构建iOS的时候,清除了一下缓存。就把这个文件删除了,然后项目就运行不起来了,各种报错
No signature of method: build_1k00qwv33rv4gwhb5tm4gxju2.android() is applicable for argument types: (build_1k00qwv33rv4gwhb5tm4gxju2$_run_closure2) values: [build_1k00qwv33rv4gwhb5tm4gxju2$_run_closure2@603347b1]
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/enlee/.pub-cache/hosted/pub.flutter-io.cn/reactive_ble_mobile-5.3.1/android/build.gradle' line: 40
* What went wrong:
A problem occurred evaluating project ':reactive_ble_mobile'.
> No signature of method: build_1k00qwv33rv4gwhb5tm4gxju2.android() is applicable for argument types: (build_1k00qwv33rv4gwhb5tm4gxju2$_run_closure2) values: [build_1k00qwv33rv4gwhb5tm4gxju2$_run_closure2@603347b1]
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
花费了上午的时间,清除pod,替换Java版本,所有的方法都试过了。依旧没有效果,去茶水间装水时想到,要不试下回退代码(从来没想过代码会有什么问题,应该刚刚才运行过),然后发现竟然能通过。就一点点回退排查,最后发现是丢失这个文件导致的。在这里做一下记录,以帮助遇到类似问题的小伙伴。