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

Flutter中无法安装flutter_secure_storage最新版本及插件异常求助

Flutter Secure Storage 版本升级与 MissingPluginException 问题排查

问题现象

运行时抛出异常:

已发生异常。MissingPluginException
(MissingPluginException(未找到通道plugins.it_nomads.com/flutter_secure_storage上的write方法实现))

排查后发现当前依赖的flutter_secure_storage版本为4.2.1,而最新稳定版本为9.2.2,推测版本过旧是导致上述错误的原因。但手动在`pubspec.yaml`中将版本改为9.2.2时,出现构建失败。

flutter pub outdated 输出结果

Showing outdated packages.
[*] indicates versions that are not the latest available.

Package Name                  Current     Upgradable  Resolvable  Latest   

direct dependencies:
async                         *2.11.0     *2.11.0     *2.11.0     2.12.0   
flutter_secure_storage        *4.2.1      *4.2.1      *4.2.1      9.2.2    
intl                          *0.19.0     *0.19.0     *0.19.0     0.20.1   
path                          *1.9.0      *1.9.0      *1.9.0      1.9.1    

dev_dependencies:
json_serializable             *6.9.0      *6.9.0      *6.9.0      6.9.2    

transitive dependencies:     
archive                       *3.6.1      *3.6.1      *3.6.1      4.0.2    
characters                    *1.3.0      *1.3.0      *1.3.0      1.4.0    
clock                         *1.1.1      *1.1.1      *1.1.1      1.1.2    
collection                    *1.19.0     *1.19.0     *1.19.0     1.19.1   
device_info_plus              *10.1.2     *10.1.2     *10.1.2     11.2.0   
image                         *4.3.0      *4.3.0      *4.3.0      4.5.2
js                            *0.6.7      0.7.1       0.7.1       0.7.1
material_color_utilities      *0.11.1     *0.11.1     *0.11.1     0.12.0
meta                          *1.15.0     *1.15.0     *1.15.0     1.16.0
source_span                   *1.10.0     *1.10.0     *1.10.0     1.10.1
stack_trace                   *1.12.0     *1.12.0     *1.12.0     1.12.1
stream_channel                *2.1.2      *2.1.2      *2.1.2      2.1.3
string_scanner                *1.3.0      *1.3.0      *1.3.0      1.4.1
term_glyph                    *1.2.1      *1.2.1      *1.2.1      1.2.2
win32_registry                *1.1.5      *1.1.5      *1.1.5      2.0.1

transitive dev_dependencies:
_fe_analyzer_shared           *76.0.0     *76.0.0     *76.0.0     78.0.0
analyzer                      *6.11.0     *6.11.0     *6.11.0     7.1.0
analyzer_plugin               *0.11.3     *0.11.3     *0.11.3     0.12.0
boolean_selector              *2.1.1      *2.1.1      *2.1.1      2.1.2
dart_style                    *2.3.7      *2.3.7      *2.3.7      3.0.1
fake_async                    *1.3.1      *1.3.1      *1.3.1      1.3.2
leak_tracker                  *10.0.7     *10.0.7     *10.0.7     10.0.8
leak_tracker_flutter_testing  *3.0.8      *3.0.8      *3.0.8      3.0.9
matcher                       *0.12.16+1  *0.12.16+1  *0.12.16+1  0.12.17
source_gen                    *1.5.0      *1.5.0      *1.5.0      2.0.0
test_api                      *0.7.3      *0.7.3      *0.7.3      0.7.4
vm_service                    *14.3.0     *14.3.0     *14.3.0     15.0.0

1 upgradable dependency is locked (in pubspec.lock) to an older version.
To update it, use `flutter pub upgrade`.

已尝试的解决命令

flutter pub cache clean
flutter clean
flutter upgrade
flutter pub upgrade --major-versions 

需要解决的问题:

  • 如何修复旧版本flutter_secure_storage的MissingPluginException?
  • 升级到9.2.2版本时构建失败的原因是什么,怎么修复?

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.15 06:23:22