You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flutter编译或升级时出现pub.dev公告解码失败错误

解决Flutter编译/升级时的advisoriesUpdated must be a String错误

错误信息

Failed to decode advisories for archive from https://pub.dev.

FormatException: advisoriesUpdated must be a String

package:pub/src/source/hosted.dart 670 HostedSource._extractAdvisoryDetailsForPackage

package:pub/src/source/hosted.dart 622 HostedSource._fetchAdvisories

===== asynchronous gap ===========================

package:pub/src/source/hosted.dart 839 HostedSource._getAdvisories

===== asynchronous gap ===========================

package:pub/src/source/hosted.dart 1120 HostedSource.getAdvisoriesForPackageVersion

===== asynchronous gap ===========================

package:pub/src/solver/report.dart 425 SolveReport._reportPackage

解决步骤

  • 清除pub缓存:在终端执行 flutter pub cache clean
  • 重新拉取项目依赖:执行 flutter pub get
  • 若问题未解决,升级Flutter到最新稳定版本:执行 flutter upgrade
  • 以上步骤无效时,删除项目根目录下的pubspec.lock文件,再重新执行flutter pub get

内容的提问来源于stack exchange,提问作者AVEbrahimi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.01 21:14:53