【问题标题】:A problem occurred configuring project ':shared_preferences_linux'配置项目 ':shared_preferences_linux' 时出现问题
【发布时间】:2020-11-23 10:04:01
【问题描述】:

当我添加一个依赖 shared_preferences: ^0.5.8

  • 在哪里: 脚本 'D:\flutter\packages\flutter_tools\gradle\flutter.gradle' 行:362

  • 出了什么问题: 配置项目 ':shared_preferences_linux' 时出现问题。

在 org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler 类型的对象上找不到参数 [project ':path_provider_linux'] 的方法 implementation()。

pubspec.ymal

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2
  shared_preferences: ^0.5.8
dev_dependencies:
  flutter_test:
    sdk: flutter

【问题讨论】:

    标签: flutter


    【解决方案1】:

    您必须显示 pubspec.yaml 文件

    【讨论】:

    • @nick 当你写命令时flutter pub get 结果还好吗?
    • @nick 何时显示project ':path_provider_linux'] 的问题和错误?
    【解决方案2】:

    问题已经解决,原因是SDK版本太低,v1,12.13+h9更新到1.17.5

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-12-17
      • 2021-04-09
      • 2021-10-26
      • 2020-10-17
      • 2020-08-24
      • 2021-05-15
      • 2020-08-23
      • 2021-01-09
      相关资源
      最近更新 更多