我正在尝试将 Excel 文件保存到本地存储,但在创建文件时遇到此错误。我正在使用物理设备进行调试。仅当设备具有外部 SD 卡并配置为内部存储时才有效。但是,当我使用 SD 卡(配置为便携式存储)在不同的设备(物理设备)上运行该应用程序时,它不起作用,并且出现以下错误。
错误
[ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: FileSystemException: Creation failed, path = '/storage/emulated/0/Traders' (OS Error: Operation not permitted, errno = 1)
E/flutter (15532): #0 _Directory.create.<anonymous closure> (dart:io/directory_impl.dart:117:11)
E/flutter (15532): #1 _rootRunUnary (dart:async/zone.dart:1362:47)
E/flutter (15532): #2 _CustomZone.runUnary (dart:async/zone.dart:1265:19)
E/flutter (15532): #3 _FutureListener.handleValue (dart:async/future_impl.dart:152:18)
E/flutter (15532): #4 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:704:45)
E/flutter (15532): #5 Future._propagateToListeners (dart:async/future_impl.dart:733:32)
E/flutter (15532): #6 Future._completeWithValue (dart:async/future_impl.dart:539:5)
E/flutter (15532): #7 Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:577:7)
E/flutter (15532): #8 _rootRun (dart:async/zone.dart:1354:13)
E/flutter (15532): #9 _CustomZone.run (dart:async/zone.dart:1258:19)
E/flutter (15532): #10 …Run Code Online (Sandbox Code Playgroud) 我是 Flutter 新手,刚刚学会了如何在 Dart 中使用隔离。当我尝试通过隔离访问共享首选项时,它会抛出以下给出的错误。当我尝试访问 Firebase 分析和远程配置时,也会出现此错误。如何解决此问题并访问隔离内的 SharedPreference、FirebaseRemote 配置、FirebaseFirestore?
[ERROR:flutter/runtime/dart_isolate.cc(882)] Unhandled exception:
E/flutter (23694): ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized.
E/flutter (23694): If you're running an application and need to access the binary messenger before `runApp()` has been called (for example, during plugin initialization), then you need to explicitly call the `WidgetsFlutterBinding.ensureInitialized()` first.
E/flutter (23694): If you're running a test, you can call the `TestWidgetsFlutterBinding.ensureInitialized()` as the first line in your test's `main()` method to initialize the binding. …Run Code Online (Sandbox Code Playgroud) 我尝试使用此API来获取订阅信息,但收到以下错误
{
"error": {
"code": 403,
"message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console.",
"errors": [
{
"message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console.",
"domain": "androidpublisher",
"reason": "projectNotLinked"
}
]
}
}
Run Code Online (Sandbox Code Playgroud)
我已在 Google Cloud Platform 中启用了 Google Play Android Developer API。还完成了所有 OAuth 同意屏幕并设置范围
参考视频
在我的应用程序主页上,我有一个列表视图,每当用户单击新页面时都会重建该视图。我已经使用 flutter_bloc 插件实现了块模式,但我不知道如何更改另一个小部件的状态。