flutter - Flutter:无法确定任务':shared_preferences:compileDebugAidl'的依赖关系
问题描述
我在颤振中创建了新应用程序,运行它时它可以工作,但是当我添加 shared_preferences 包时,运行它时出现此错误
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':shared_preferences:compileDebugAidl'.
> Could not resolve all task dependencies for configuration ':shared_preferences:debugCompileClasspath'.
> Could not resolve project :shared_preferences_macos.
Required by:
project :shared_preferences
> Unable to find a matching configuration of project :shared_preferences_macos:
- None of the consumable configurations have attributes.
> Could not resolve project :shared_preferences_web.
Required by:
project :shared_preferences
> Unable to find a matching configuration of project :shared_preferences_web:
- None of the consumable configurations have attributes.
* 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 866ms
Gradle task assembleDebug failed with exit code 1
这是我的 pubspec.yaml
dependencies:
flutter:
sdk: flutter
shared_preferences: ^0.5.3+1
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
那有什么问题,我该如何解决?请帮帮我...谢谢
解决方案
我能够通过运行以下命令来解决这个问题:
$ flutter pub cache repair
推荐阅读
- servicestack - ServiceStack 结构化日志记录
- java - 如何显示来自另一个类的新 JPanel?
- google-apps-script - 调用 setValues() 时日期更改
- python - pip uninstall tensorflow 抛出 _csv.Error: line contains NUL
- reactjs - 渲染的组件然后消失(react/redux/Firebase)
- oracle - 使用游标在 Oracle SQL 中执行 2 个 for 循环
- javascript - APIRest 文件中的问题通过 node.js 中的 GET
- algorithm - 金矿问题 - for 循环的序列
- node.js - 使用 websockets 时 mocha 测试未退出,即使使用 websocket.close/terminae
- c# - 带有 CKEditor 到 Azure WebApp 的 ASP.Net MVC 应用程序给出“无法启动 CKFinder:语言文件丢失或损坏”