[MACOS] Undefined symbols for architecture x86_64:
I am facing this issue while building the macos app, not sure what the issue is :
Undefined symbols for architecture x86_64:
"___gxx_personality_v0", referenced from:
getAppWindow() in bitsdojo_window_macos(bitsdojo_window.o)
____Z10moveWindowP8NSWindow_block_invoke in bitsdojo_window_macos(bitsdojo_window.o)
setSize(NSWindow*, int, int) in bitsdojo_window_macos(bitsdojo_window.o)
getScreenInfoForWindow(NSWindow*, _BDWScreenInfo*) in bitsdojo_window_macos(bitsdojo_window.o)
setPositionForWindow(NSWindow*, _BDWOffset*) in bitsdojo_window_macos(bitsdojo_window.o)
____Z20setPositionForWindowP8NSWindowP10_BDWOffset_block_invoke in bitsdojo_window_macos(bitsdojo_window.o)
setRectForWindow(NSWindow*, _BDWRect*) in bitsdojo_window_macos(bitsdojo_window.o)
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any idea to resolve?
@huntergps no idea , it could be the architecuture issue that this library is compiled with 32 bit and not 64. But I am not sure.
I had the same problem after upgrading flutter to a 2.6...-pre version. Downgrading to 2.5 eliminated the issue.
@jonny7737 thanks this worked for me, but in release build my window is not visible.
Same here. Not able to use this plugin because of this error.
same issue
This issue still exists with Flutter 2.8. This package should not be used.
the fix posted here: https://github.com/bitsdojo/bitsdojo_window/issues/119#issue-1076270961 worked for me.
Seeing this on M1 Mac running Monterey. Tried the above fix - no go.
Had to remove package.
It appears there is a problem with one/some of the CocoaPods when trying to download for the ARM architecture. Here is a specific error message:
[/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54]():in require': dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi_c.bundle, 0x0009): tried: '/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi_c.bundle' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')) - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi_c.bundle (LoadError)`
Specifically notice this: mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
And this is also on an M1 Mac (Apple Silicon) running Monterey.
I did find a solution that worked, but it causes the application to run as "Intel" and not "Apple". This is from here: https://github.com/CocoaPods/CocoaPods/issues/9907#issuecomment-879969967
It is an issue with ffi in CocoaPods. Basically, running the following should fix the issue:
sudo arch -x86_64 gem install ffi
Then from the macOS folder of your flutter app, run:
arch -x86_64 pod install
I assume when CocoaPods fixes this issue, the problem will resolve itself.
OR, you can uninstall cocoa pods using gem (sudo gem uninstall cocoapods) and install cocoapods with brew, which is mentioned later in the comments linked above. That also seems to work and is the option I followed.