[GH-ISSUE #64] [Bug] Unable build on macOS #34

Closed
opened 2026-03-23 20:30:44 +00:00 by mirror · 2 comments
Owner

Originally created by @RanKKI on GitHub (Nov 21, 2021).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/64

I followed the Getting Started from the README.md, and do the commands step by step. but got build error when I run it from the VS code.

Undefined symbols for architecture x86_64:
  "_link_me_please", referenced from:
      static flowy_sdk.FlowySdkPlugin.dummyMethodToEnforceBundling() -> () in flowy_sdk(FlowySdkPlugin.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
** BUILD FAILED **

Building macOS application...                                           
Exception: Build process failed

I can run the app if I remove the code from the method dummyMethodToEnforceBundling, but no any display with the error below.

Building macOS application...                                           
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Invalid argument(s): Failed to lookup symbol 'set_stream_port': dlsym(RTLD_DEFAULT, set_stream_port): symbol not found
#0      DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:34:70)
#1      _set_stream_port (package:flowy_sdk/ffi.dart)
#2      _set_stream_port (package:flowy_sdk/ffi.dart)
#3      set_stream_port (package:flowy_sdk/ffi.dart:79:10)
#4      FlowySDK.init (package:flowy_sdk/flowy_sdk.dart:23:9)
#5      RustSDKInitTask.initialize.<anonymous closure> (package:app_flowy/startup/tasks/sdk_task.dart:23:43)
#6      RustSDKInitTask.initialize.<anonymous closure> (package:app_flowy/startup/tasks/sdk_task.dart:19:59)
#7      _rootRunUnary (dart:async/zone.dart:1436:47)
#8      _CustomZone.runUnary (dart:async/zone.dart:1335:19)
<asynchronous suspension>
#9      AppLauncher.launch (package:app_flowy/startup/launcher.dart:36:7)
<asynchronous suspension>

Additional context

❯ flutter doctor -v
[✓] Flutter (Channel dev, 2.6.0-11.0.pre, on macOS 11.0.1 20B29 darwin-x64, locale en-AU)
    • Flutter version 2.6.0-11.0.pre at /Users/hcm-b0208/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4b330ddbed (9 weeks ago), 2021-09-16 17:29:58 -0700
    • Engine revision 5b81c6d615
    • Dart version 2.15.0 (build 2.15.0-116.0.dev)

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/hcm-b0208/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] VS Code (version 1.62.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.28.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 11.0.1 20B29 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 96.0.4664.55

! Doctor found issues in 1 category.
Originally created by @RanKKI on GitHub (Nov 21, 2021). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/64 I followed the `Getting Started` from the README.md, and do the commands step by step. but got build error when I run it from the VS code. ``` Undefined symbols for architecture x86_64: "_link_me_please", referenced from: static flowy_sdk.FlowySdkPlugin.dummyMethodToEnforceBundling() -> () in flowy_sdk(FlowySdkPlugin.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) note: Using new build system note: Building targets in parallel note: Planning build note: Constructing build description ** BUILD FAILED ** Building macOS application... Exception: Build process failed ``` I can run the app if I remove the code from the method `dummyMethodToEnforceBundling`, but no any display with the error below. ``` Building macOS application... [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Invalid argument(s): Failed to lookup symbol 'set_stream_port': dlsym(RTLD_DEFAULT, set_stream_port): symbol not found #0 DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:34:70) #1 _set_stream_port (package:flowy_sdk/ffi.dart) #2 _set_stream_port (package:flowy_sdk/ffi.dart) #3 set_stream_port (package:flowy_sdk/ffi.dart:79:10) #4 FlowySDK.init (package:flowy_sdk/flowy_sdk.dart:23:9) #5 RustSDKInitTask.initialize.<anonymous closure> (package:app_flowy/startup/tasks/sdk_task.dart:23:43) #6 RustSDKInitTask.initialize.<anonymous closure> (package:app_flowy/startup/tasks/sdk_task.dart:19:59) #7 _rootRunUnary (dart:async/zone.dart:1436:47) #8 _CustomZone.runUnary (dart:async/zone.dart:1335:19) <asynchronous suspension> #9 AppLauncher.launch (package:app_flowy/startup/launcher.dart:36:7) <asynchronous suspension> ``` **Additional context** ``` ❯ flutter doctor -v [✓] Flutter (Channel dev, 2.6.0-11.0.pre, on macOS 11.0.1 20B29 darwin-x64, locale en-AU) • Flutter version 2.6.0-11.0.pre at /Users/hcm-b0208/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 4b330ddbed (9 weeks ago), 2021-09-16 17:29:58 -0700 • Engine revision 5b81c6d615 • Dart version 2.15.0 (build 2.15.0-116.0.dev) [!] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Users/hcm-b0208/Library/Android/sdk ✗ cmdline-tools component is missing Run `path/to/sdkmanager --install "cmdline-tools;latest"` See https://developer.android.com/studio/command-line for more details. ✗ Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/macos#android-setup for more details. [✓] Xcode - develop for iOS and macOS (Xcode 12.4) • Xcode at /Applications/Xcode.app/Contents/Developer • CocoaPods version 1.11.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2020.3) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165) [✓] VS Code (version 1.62.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.28.0 [✓] Connected device (2 available) • macOS (desktop) • macos • darwin-x64 • macOS 11.0.1 20B29 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 96.0.4664.55 ! Doctor found issues in 1 category. ```
Author
Owner

@appflowy commented on GitHub (Nov 22, 2021):

Hi @RanKKI Please show me your Rust toolchain.

rustup show

<!-- gh-comment-id:975321727 --> @appflowy commented on GitHub (Nov 22, 2021): Hi @RanKKI Please show me your Rust toolchain. `rustup show`
Author
Owner

@RanKKI commented on GitHub (Nov 22, 2021):

Hi @RanKKI Please show me your Rust toolchain.

rustup show

Hi, I tried the method from https://github.com/AppFlowy-IO/appflowy/issues/68#issuecomment-975033846, and it's works~ thanks

<!-- gh-comment-id:975368757 --> @RanKKI commented on GitHub (Nov 22, 2021): > Hi @RanKKI Please show me your Rust toolchain. > > `rustup show` Hi, I tried the method from https://github.com/AppFlowy-IO/appflowy/issues/68#issuecomment-975033846, and it's works~ thanks
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#34
No description provided.