Flutter编译或升级时出现pub.dev公告解码失败错误
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

