Flutter Could not resolve project :path_provider_macos.


解决方案:先clean,再repair


ZBMAC-C02VQ1ZYO:d$ flutter clean Cleaning Xcode workspace... 2.5s Deleting build... 258ms Deleting .dart_tool... 4ms Deleting .android... 6ms Deleting .ios... 6ms ZBMAC-C02VQ1$ flutter pub cache repair Resetting Git repository for flutter_boost 1.9.1+1...

  

错误信息:

* What went wrong:
Could not determine the dependencies of task ':path_provider:compileDebugAidl'.
> Could not resolve all task dependencies for configuration ':path_provider:debugCompileClasspath'.
   > Could not resolve project :path_provider_macos.
     Required by:
         project :path_provider
      > Unable to find a matching configuration of project :path_provider_macos:
          - None of the consumable configurations have attributes.

  

如果是在纯Flutter项目执行,这样基本就修复了。

如果是Flutter以Module形式被原生项目依赖,那么有可能不行,这时候,就按报错提示修复,原生项目找到

path_provider_macos 相关文件夹,有可能有多个,删除项目报错那个,重新编译运行即可。





如果需要使用path_provider_macos相关的东西。
path_provider_macos这个module,找到对应本地的目录,把其他版本对应的android目录下文件拷贝到报错这个版本的android目录下就解决了。



一般path_provider_macos目录在

   xxx/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4/下。

 

 

原文地址:https://www.cnblogs.com/spring87/p/12966483.html