使用shared_preferences插件报错,求解决
来源:9-5 基于shared_preferences本地存储操作【本地存储】
Dejan_he
2023-01-11
Syncing files to device Android SDK built for x86…
Reloaded 1 of 663 libraries in 407ms.
E/flutter ( 8277): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)
E/flutter ( 8277):
E/flutter ( 8277): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)
E/flutter ( 8277):
E/flutter ( 8277): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)
E/flutter ( 8277):
2回答
-
Dejan_he
提问者
2023-01-12
最终排查出了问题是"本地的Android SDK版本没有对应上shared_preferences插件最新版本的支持", 解决办法: cmd 执行> flutter doctor。根据错误的选项一项一项的修复即可.
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app.apk...
Debug service listening on ws://127.0.0.1:3101/FZrHnIA_7e0=/ws
Syncing files to device Android SDK built for x86...
D/EGL_emulation(10051): eglMakeCurrent: 0xdc413460: ver 2 0 (tinfo 0xc8fb1560)
D/EGL_emulation(10051): eglMakeCurrent: 0xdc412e60: ver 2 0 (tinfo 0xc8fb11d0)
10 -
CrazyCodeBoy
2023-01-12
执行下flutter pub get
然后将APP卸载重新安装看看。022023-01-12
相似问题