crazecoder / open_file

A plug-in that can call native APP to open files with string result in flutter, support iOS(UTI) / android(intent) / PC(ffi) / web(dart:html)
BSD 3-Clause "New" or "Revised" License
252 stars 438 forks source link

Linux throws LateInitializationError #303

Closed markus-rothenbacher-tech closed 1 month ago

markus-rothenbacher-tech commented 1 month ago

I use the package as it is show in the example under linux and I get the error

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: LateInitializationError: Field '_instance@1460239922' has not been initialized.
#0      OpenFilePlatform._instance (package:open_file_platform_interface/src/platform_interface/open_file_platform.dart)
#1      OpenFilePlatform.platform (package:open_file_platform_interface/src/platform_interface/open_file_platform.dart:10:43)
#2      OpenFile.open (package:open_file/open_file.dart:26:29)
#3      MyScreenshotWidgetState.downloadAsPng (package:reyondx_design/src/atoms/screenshot_widget.dart:50:39)
<asynchronous suspension>

Do I use it wrong. As I understand it, it should initialize the _instance variable on it's own.

TechnicJelle commented 1 month ago

I just noticed this as well.

Full stacktrace ``` [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: LateInitializationError: Field '_instance@37239922' has not been initialized. #0 OpenFilePlatform._instance (package:open_file_platform_interface/src/platform_interface/open_file_platform.dart) #1 OpenFilePlatform.platform (package:open_file_platform_interface/src/platform_interface/open_file_platform.dart:10:43) #2 OpenFile.open (package:open_file/open_file.dart:26:29) #3 ProjectsScreen.build... (package:bluemap_gui/main_menu/settings/projects_screen.dart:58:34) #4 PopupMenuItemState.handleTap (package:flutter/src/material/popup_menu.dart:351:19) #5 _InkResponseState.handleTap (package:flutter/src/material/ink_well.dart:1170:21) #6 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:351:24) #7 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:656:11) #8 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:313:5) #9 BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:246:7) #10 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:703:9) #11 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:98:12) #12 PointerRouter._dispatchEventToRoutes. (package:flutter/src/gestures/pointer_router.dart:143:9) #13 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:633:13) #14 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:141:18) #15 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:127:7) #16 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:501:19) #17 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:481:22) #18 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:450:11) #19 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:426:7) #20 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:389:5) #21 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:336:7) #22 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:305:9) #23 _invoke1 (dart:ui/hooks.dart:328:13) #24 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:442:7) #25 _dispatchPointerDataPacket (dart:ui/hooks.dart:262:31) ```

Possibly relevant info: OS: Manjaro Linux x86_64 Kernel: 6.6.54-2-MANJARO DE: Xfce 4.18 Shell: zsh 5.9 CPU: AMD Ryzen 7 5800H

TechnicJelle commented 1 month ago

Yess, it works! Thanks, @crazecoder!

markus-rothenbacher-tech commented 1 month ago

@crazecoder Thanks it works