flutter报错this and base files have different roots

背景

在安卓原生项目集成flutter,sync时会报错Could not create task ':flutter_plugin_android_lifecycle:generateDebugUnitTestConfig'. this and base files have different roots:,根据网上说法原因为:

pub get下载的缓存位置和项目位置不在同一个磁盘,就会报这个错。

解决

设置环境变量PUB_CACHE为flutter同一个盘符的路径,然后进入项目执行flutter pub get


flutter报错this and base files have different roots
http://blog.icy8.cn/posts/660443059/
作者
icy8
发布于
2023年10月23日
许可协议