微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

shared_preference 中的问题:^2.0.3直到现在 10-03-2021

如何解决shared_preference 中的问题:^2.0.3直到现在 10-03-2021

更新 Flutter 后,我的一个项目出现问题。错误日志如下。主要问题是偏好没有完美地保存在设备上。一些偏好是保存和一些离开。我从 Fluttersharedprefs.xml 中检查了它

E/MethodChannel#plugins.Flutter.io/shared_preferences( 9295):   at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2086)
E/MethodChannel#plugins.Flutter.io/shared_preferences( 9295):   at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:848)
E/MethodChannel#plugins.Flutter.io/shared_preferences( 9295):   at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1394)
E/MethodChannel#plugins.Flutter.io/shared_preferences( 9295):   at io.Flutter.plugins.sharedpreferences.MethodCallHandlerImpl.commitAsync(MethodCallHandlerImpl.java:137)
E/MethodChannel#plugins.Flutter.io/shared_preferences( 9295):   at io.Flutter.plugins.sharedpreferences.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.java:96)
E/MethodChannel#plugins.Flutter.io/shared_preferences( 9295):   at io.Flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/MethodChannel#plugins.Flutter.io/shared_preferences( 9295):   at io.Flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#plugins.Flutter.io/shared_preferences( 9295):   at io.Flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
E/MethodChannel#plugins.Flutter.io/shared_preferences( 9295):   at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#plugins.Flutter.io/shared_preferences( 9295):   at android.os.MessageQueue.next(MessageQueue.java:340)
E/MethodChannel#plugins.Flutter.io/shared_preferences( 9295):   at android.os.Looper.loop(Looper.java:183)
E/MethodChannel#plugins.Flutter.io/shared_preferences( 9295):   at android.app.ActivityThread.main(ActivityThread.java:7853)
E/MethodChannel#plugins.Flutter.io/shared_preferences( 9295):   at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#plugins.Flutter.io/shared_preferences( 9295):   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:526)
E/MethodChannel#plugins.Flutter.io/shared_preferences( 9295):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1034)
E/Flutter ( 9295): [ERROR:Flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: PlatformException(error,Task io.Flutter.plugins.sharedpreferences.MethodCallHandlerImpl$1@d8dbf46 rejected from java.util.concurrent.ThreadPoolExecutor@6e10313[Running,pool size = 1,active threads = 1,queued tasks = 0,completed tasks = 14],null,java.util.concurrent.RejectedExecutionException: Task io.Flutter.plugins.sharedpreferences.MethodCallHandlerImpl$1@d8dbf46 rejected from java.util.concurrent.ThreadPoolExecutor@6e10313[Running,completed tasks = 14]

有很多日志,但是由于stackoverflow的空间问题,我写不出来......

解决方法

我建议您按照以下说明在官方 Flutter 存储库中向 Flutter 团队提交错误报告:https://github.com/flutter/plugins#issues

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。