bitsdojo_window icon indicating copy to clipboard operation
bitsdojo_window copied to clipboard

[MACOS] Undefined symbols for architecture x86_64:

Open naveenneev opened this issue 4 years ago • 11 comments

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)

naveenneev avatar Sep 09 '21 15:09 naveenneev

Any idea to resolve?

huntergps avatar Sep 17 '21 14:09 huntergps

@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.

naveenneev avatar Sep 22 '21 09:09 naveenneev

I had the same problem after upgrading flutter to a 2.6...-pre version. Downgrading to 2.5 eliminated the issue.

jonny7737 avatar Sep 25 '21 14:09 jonny7737

@jonny7737 thanks this worked for me, but in release build my window is not visible.

naveenneev avatar Sep 28 '21 08:09 naveenneev

Same here. Not able to use this plugin because of this error.

gardc avatar Nov 17 '21 15:11 gardc

same issue

ozz-rjq avatar Nov 28 '21 15:11 ozz-rjq

This issue still exists with Flutter 2.8. This package should not be used.

jonny7737 avatar Dec 09 '21 16:12 jonny7737

the fix posted here: https://github.com/bitsdojo/bitsdojo_window/issues/119#issue-1076270961 worked for me.

jonny7737 avatar Dec 14 '21 15:12 jonny7737

Seeing this on M1 Mac running Monterey. Tried the above fix - no go.

Had to remove package.

rickbsgu avatar Apr 04 '22 23:04 rickbsgu

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.

mrunion avatar Apr 11 '22 18:04 mrunion

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.

mrunion avatar Apr 11 '22 19:04 mrunion