bitsdojo / bitsdojo_window

A Flutter package that makes it easy to customize and work with your Flutter desktop app window.
http://www.youtube.com/watch?v=bee2AHQpGK4
MIT License
815 stars 229 forks source link

Archived App does not start #162

Open lexxxel opened 2 years ago

lexxxel commented 2 years ago

After compiling my project in release mode. I'm able to start the binary. If I archive it via Xcode and export it as *.app, I get the following stack trace:

flutter: Invalid argument(s): Failed to lookup symbol 'bitsdojo_window_api': dlsym(RTLD_DEFAULT, bitsdojo_window_api): symbol not found
flutter: #0      DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:34)
flutter: #1      bitsdojoWindowAPI (package:bitsdojo_window_macos/src/native_api.dart:199)
flutter: #2      _publicAPI (package:bitsdojo_window_macos/src/native_api.dart)
flutter: #3      getAppWindow (package:bitsdojo_window_macos/src/native_api.dart)
flutter: #4      new MacAppWindow._ (package:bitsdojo_window_macos/src/app_window.dart)
flutter: #5      MacAppWindow._instance (package:bitsdojo_window_macos/src/app_window.dart:14)
flutter: #6      appWindow (package:bitsdojo_window/src/app_window.dart)
flutter: #7      WindowTitleBarBox.build (package:bitsdojo_window/src/widgets/window_caption.dart:42)
flutter: #8      StatelessElement.build (package:flutter/src/widgets/framework.dart:4827)
flutter: #9      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4754)
flutter: #10     Element.rebuild (package:flutter/src/widgets/framework.dart:4477)
flutter: #11     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4735)
flutter: #12     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4729)
flutter: #13     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3790)
flutter: #14     MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6422)
flutter: #15     MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6433)
flutter: #16     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3790)
flutter: #17     Element.updateChild (package:flutter/src/widgets/framework.dart:3540)
flutter: #18     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4780)
flutter: #19     Element.rebuild (package:flutter/src/widgets/framework.dart:4477)
flutter: #20     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4735)
flutter: #21     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4729)
flutter: #22     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3790)
flutter: #23     Element.updateChild (package:flutter/src/widgets/framework.dart:3540)
flutter: #24     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4780)
flutter: #25     Element.rebuild (package:flutter/src/widgets/framework.dart:4477)
flutter: #26     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4735)
flutter: #27     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4729)
flutter: #28     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3790)
flutter: #29     Element.updateChild (package:flutter/src/widgets/framework.dart:3540)
flutter: #30     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4780)
flutter: #31     Element.rebuild (package:flutter/src/widgets/framework.dart:4477)
flutter: #32     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4735)
flutter: #33     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4729)
flutter: #34     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3790)
flutter: #35     MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6422)
flutter: #36     MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6433)
flutter: #37     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3790)
flutter: #38     Element.updateChild (package:flutter/src/widgets/framework.dart:3540)
flutter: #39     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4780)
flutter: #40     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4928)
flutter: #41     Element.rebuild (package:flutter/src/widgets/framework.dart:4477)
flutter: #42     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4735)
flutter: #43     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4919)
flutter: #44     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4729)
flutter: #45     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3790)
flutter: #46     Element.updateChild (package:flutter/src/widgets/framework.dart:3540)
flutter: #47     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4780)
flutter: #48     Element.rebuild (package:flutter/src/widgets/framework.dart:4477)
flutter: #49     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4735)
flutter: #50     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4729)
flutter: #51     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3790)
flutter: #52     Element.updateChild (package:flutter/src/widgets/framework.dart:3540)
flutter: #53     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4780)
flutter: #54     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4928)
flutter: #55     Element.rebuild (package:flutter/src/widgets/framework.dart:4477)
flutter: #56     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4735)
flutter: #57     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4919)
flutter: #58     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4729)
flutter: #59     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3790)
flutter: #60     Element.updateChild (package:flutter/src/widgets/framework.dart:3540)
flutter: #61     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6284)
flutter: #62     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3790)
flutter: #63     Element.updateChild (package:flutter/src/widgets/framework.dart:3540)
flutter: #64     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4780)
flutter: #65     Element.rebuild (package:flutter/src/widgets/framework.dart:4477)
flutter: #66     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4735)
flutter: #67     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4729)
flutter: #68     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3790)
flutter: #69     Element.updateChild (package:flutter/src/widgets/framework.dart:3540)
flutter: #70     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6284)
flutter: #71     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3790)
flutter: #72     Element.updateChild (package:flutter/src/widgets/framework.dart:3540)
flutter: #73     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4780)
flutter: #74     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4928)
flutter: #75     Element.rebuild (package:flutter/src/widgets/framework.dart:4477)
flutter: #76     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4735)
flutter: #77     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4919)
flutter: #78     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4729)
flutter: #79     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3790)
flutter: #80     Element.updateChild (package:flutter/src/widgets/framework.dart:3540)
flutter: #81     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4780)
flutter: #82     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4928)
flutter: #83     Element.rebuild (package:flutter/src/widgets/framework.dart:4477)
flutter: #84     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4735)
flutter: #85     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4919)
flutter: #86     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4729)
flutter: #87     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3790)
flutter: #88     Element.updateChild (package:flutter/src/widgets/framework.dart:3540)
flutter: #89     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4780)
flutter: #90     Element.rebuild (package:flutter/src/widgets/framework.dart:4477)
flutter: #91     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4735)
flutter: #92     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4729)
flutter: #93     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3790)
flutter: #94     Element.updateChild (package:flutter/src/widgets/framework.dart:3540)
flutter: #95     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4780)
flutter: #96     Element.rebuild (package:flutter/src/widgets/framework.dart:4477)
flutter: #97     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4735)
flutter: #98     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4729)
flutter: #99     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3790)
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Invalid argument(s): Failed to lookup symbol 'bitsdojo_window_api': dlsym(RTLD_DEFAULT, bitsdojo_window_api): symbol not found
#0      DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:34)
#1      bitsdojoWindowAPI (package:bitsdojo_window_macos/src/native_api.dart:199)
#2      _publicAPI (package:bitsdojo_window_macos/src/native_api.dart)
#3      _setWindowCanBeShown (package:bitsdojo_window_macos/src/native_api.dart)
#4      setWindowCanBeShown (package:bitsdojo_window_macos/src/native_api.dart)
#5      BitsdojoWindowMacOS.doWhenWindowReady.<anonymous closure> (package:bitsdojo_window_macos/src/bitsdojo_window_macos_real.dart:14)
#6      _rootRunUnary (dart:async/zone.dart:1434)
lexxxel commented 2 years ago

Looks like this issue occurs because xcode strips the binary. Disabling stripping fixes the issue, but this should not be the solution

efraespada commented 2 years ago

@lexxxel how do you disable the stripping in XCode?

lexxxel commented 2 years ago

image there you go - by the way this is not the optimal setting, just the first one that worked for us.

lexxxel commented 2 years ago

For us, what worked was:

Stip Linked Product = Yes
Strip Style = Debugging Symbols
Strip Swift Symbols  = Yes