Flutter项目pub get失败(错误码66)求助:依赖路径不存在
解决Flutter中integration_test路径不存在导致的pub get失败问题
错误核心信息
Because url_launcher_example depends on integration_test from path which doesn't exist (could not find package integration_test at "......\integration_test"), version solving failed.
pub get failed
exit code: 66
解决步骤
检查并修正pubspec.yaml依赖配置
打开项目根目录的pubspec.yaml,找到integration_test相关配置:- 若配置是本地路径引用(类似
path: ../integration_test),先确认指定路径下是否存在完整的integration_test包(需包含自身的pubspec.yaml文件);路径错误的话修正为正确的相对/绝对路径。 - 若无需本地依赖,直接改用Flutter SDK自带的包:
integration_test: sdk: flutter
- 若配置是本地路径引用(类似
清理缓存并重跑pub get
执行命令清理pub缓存:flutter pub cache clean回到项目目录重新获取依赖:
flutter pub get排查命令参数问题
你执行的命令带有--example参数,该参数用于获取示例项目依赖。如果是开发自己的项目,直接执行flutter pub get即可,避免因示例项目的依赖配置异常导致失败。确认项目结构合理性
如果必须使用本地路径的integration_test,核对项目层级是否匹配配置的路径:比如你的项目在xxx/url_launcher_example,那么../integration_test对应xxx/integration_test,确保该目录存在且是有效的Flutter包。
内容的提问来源于stack exchange,提问作者Akanksha
相关产品推荐
相关产品推荐

