fzyzcjy / flutter_rust_bridge

Flutter/Dart <-> Rust binding generator, feature-rich, but seamless and simple.

Home Page:https://fzyzcjy.github.io/flutter_rust_bridge/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

flutter build macos Ld: Undefined symbols: referenced from: arm64

niuhuan opened this issue · comments

Is your feature request related to a problem? Please describe.
Undefined symbols when flutter build macos on m1 chip macos

flutter_rust_bridge_codegen create app
cd app
cd rust
cargo add reqwest
flutter build macos
# or
# flutter run -d macos

Describe the solution you'd like

Describe alternatives you've considered

Additional context

微信截图_20240228101835

➜   git:(main) ✗ flutter_rust_bridge_codegen -V
flutter_rust_bridge_codegen 2.0.0-dev.25
➜   git:(main) ✗ flutter doctor version
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.7, on macOS 14.2.1 23C71 darwin-arm64, locale zh-Hans-CN)
➜   git:(main) ✗ rustup -V
rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.78.0-nightly (2bf78d12d 2024-02-18)`

I think it is that the static library for arm64 is not built, or the static library for arm64 is not link, but I don't know how to solve it

Hi, firstly it would be great to show logs (text) instead of screenshot for future searching.

Secondly, it seems like those SCD symbols are not there. Is the SCD-related a 3rd party crate? If so, it would be great to ask there, since it is usually not a bug of flutter_rust_bridge, but a missing functionality of that crate.

flutter run -d macos  
Launching lib/main.dart on macOS in debug mode...
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00008103-001D45E802D3001E }
{ platform:macOS, arch:x86_64, id:00008103-001D45E802D3001E }
ld: Undefined symbols:
  _SCDynamicStoreCopyProxies, referenced from:
      system_configuration::dynamic_store::SCDynamicStore::get_proxies::hd6479179bd2fa861 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _SCDynamicStoreCreateWithOptions, referenced from:
      system_configuration::dynamic_store::SCDynamicStore::create::h7b9e1066650f217a in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _SCNetworkInterfaceCopyAll, referenced from:
      system_configuration::network_configuration::get_interfaces::h47d304cdbfb4a2ec in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _SCNetworkInterfaceGetBSDName, referenced from:
      system_configuration::network_configuration::SCNetworkInterface::bsd_name::h6710c333fb5b0744 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _SCNetworkInterfaceGetInterfaceType, referenced from:
      system_configuration::network_configuration::SCNetworkInterface::interface_type_string::hd85ec55d052b4d0a in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _SCNetworkInterfaceGetLocalizedDisplayName, referenced from:
      system_configuration::network_configuration::SCNetworkInterface::display_name::h37777f793aafe810 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _SCNetworkReachabilityCreateWithAddress, referenced from:
      _$LT$system_configuration..network_reachability..SCNetworkReachability$u20$as$u20$core..convert..From$LT$core..net..socket_addr..SocketAddr$GT$$GT$::from::h029c960072f2ad49 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _SCNetworkReachabilityCreateWithAddressPair, referenced from:
      system_configuration::network_reachability::SCNetworkReachability::from_addr_pair::hdb55e18b8e1d7783 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _SCNetworkReachabilityCreateWithName, referenced from:
      system_configuration::network_reachability::SCNetworkReachability::from_host::hc16f36d6b3490c75 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _SCNetworkReachabilityGetFlags, referenced from:
      system_configuration::network_reachability::SCNetworkReachability::reachability::he5ffa3b6565df517 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _SCNetworkReachabilityScheduleWithRunLoop, referenced from:
      system_configuration::network_reachability::SCNetworkReachability::schedule_with_runloop::hd09425b5dde83756 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _SCNetworkReachabilityUnscheduleFromRunLoop, referenced from:
      system_configuration::network_reachability::SCNetworkReachability::unschedule_from_runloop::h2268a3965cc5ad33 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _SCNetworkServiceCopyAll, referenced from:
      system_configuration::network_configuration::SCNetworkService::get_services::h0f1995e1383ffee2 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _SCNetworkServiceGetEnabled, referenced from:
      system_configuration::network_configuration::SCNetworkService::enabled::h2b2e13c0a0bacb0b in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _SCNetworkServiceGetInterface, referenced from:
      system_configuration::network_configuration::SCNetworkService::network_interface::h7e4760ffd56fc9f2 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _SCNetworkServiceGetServiceID, referenced from:
      system_configuration::network_configuration::SCNetworkService::id::ha9395cf3ad92009b in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _SCNetworkSetCopyCurrent, referenced from:
      system_configuration::network_configuration::SCNetworkSet::new::hb3c256d3ba20d7f3 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _SCNetworkSetGetServiceOrder, referenced from:
      system_configuration::network_configuration::SCNetworkSet::service_order::ha68277a7bd963b70 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _kSCDynamicStoreUseSessionKeys, referenced from:
      system_configuration::dynamic_store::SCDynamicStoreBuilder$LT$T$GT$::create_store_options::h4f24615678881422 in librust_lib_kami.a[arm64][525](reqwest-c9a52ab4bed9e04a.reqwest.1fc08cc0ee706cb6-cgu.10.rcgu.o)
  _kSCNetworkInterfaceType6to4, referenced from:
      system_configuration::network_configuration::SCNetworkInterfaceType::from_cfstring::h29b7bf42938560c7 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _kSCNetworkInterfaceTypeBluetooth, referenced from:
      system_configuration::network_configuration::SCNetworkInterfaceType::from_cfstring::h29b7bf42938560c7 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _kSCNetworkInterfaceTypeBond, referenced from:
      system_configuration::network_configuration::SCNetworkInterfaceType::from_cfstring::h29b7bf42938560c7 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _kSCNetworkInterfaceTypeBridge, referenced from:
      system_configuration::network_configuration::SCNetworkInterfaceType::from_cfstring::h29b7bf42938560c7 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _kSCNetworkInterfaceTypeEthernet, referenced from:
      system_configuration::network_configuration::SCNetworkInterfaceType::from_cfstring::h29b7bf42938560c7 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _kSCNetworkInterfaceTypeFireWire, referenced from:
      system_configuration::network_configuration::SCNetworkInterfaceType::from_cfstring::h29b7bf42938560c7 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _kSCNetworkInterfaceTypeIEEE80211, referenced from:
      system_configuration::network_configuration::SCNetworkInterfaceType::from_cfstring::h29b7bf42938560c7 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _kSCNetworkInterfaceTypeIPSec, referenced from:
      system_configuration::network_configuration::SCNetworkInterfaceType::from_cfstring::h29b7bf42938560c7 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _kSCNetworkInterfaceTypeIPv4, referenced from:
      system_configuration::network_configuration::SCNetworkInterfaceType::from_cfstring::h29b7bf42938560c7 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _kSCNetworkInterfaceTypeIrDA, referenced from:
      system_configuration::network_configuration::SCNetworkInterfaceType::from_cfstring::h29b7bf42938560c7 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _kSCNetworkInterfaceTypeL2TP, referenced from:
      system_configuration::network_configuration::SCNetworkInterfaceType::from_cfstring::h29b7bf42938560c7 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _kSCNetworkInterfaceTypeModem, referenced from:
      system_configuration::network_configuration::SCNetworkInterfaceType::from_cfstring::h29b7bf42938560c7 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _kSCNetworkInterfaceTypePPP, referenced from:
      system_configuration::network_configuration::SCNetworkInterfaceType::from_cfstring::h29b7bf42938560c7 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _kSCNetworkInterfaceTypePPTP, referenced from:
      system_configuration::network_configuration::SCNetworkInterfaceType::from_cfstring::h29b7bf42938560c7 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _kSCNetworkInterfaceTypeSerial, referenced from:
      system_configuration::network_configuration::SCNetworkInterfaceType::from_cfstring::h29b7bf42938560c7 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _kSCNetworkInterfaceTypeVLAN, referenced from:
      system_configuration::network_configuration::SCNetworkInterfaceType::from_cfstring::h29b7bf42938560c7 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _kSCNetworkInterfaceTypeWWAN, referenced from:
      system_configuration::network_configuration::SCNetworkInterfaceType::from_cfstring::h29b7bf42938560c7 in librust_lib_kami.a[arm64][539](system_configuration-9d70ffca7cee786f.system_configuration.941b9073d9acfdde-cgu.0.rcgu.o)
  _kSCPropNetProxiesHTTPEnable, referenced from:
      reqwest::proxy::get_from_platform_impl::h0e968db131db0ba8 in librust_lib_kami.a[arm64][528](reqwest-c9a52ab4bed9e04a.reqwest.1fc08cc0ee706cb6-cgu.13.rcgu.o)
  _kSCPropNetProxiesHTTPPort, referenced from:
      reqwest::proxy::get_from_platform_impl::h0e968db131db0ba8 in librust_lib_kami.a[arm64][528](reqwest-c9a52ab4bed9e04a.reqwest.1fc08cc0ee706cb6-cgu.13.rcgu.o)
  _kSCPropNetProxiesHTTPProxy, referenced from:
      reqwest::proxy::get_from_platform_impl::h0e968db131db0ba8 in librust_lib_kami.a[arm64][528](reqwest-c9a52ab4bed9e04a.reqwest.1fc08cc0ee706cb6-cgu.13.rcgu.o)
  _kSCPropNetProxiesHTTPSEnable, referenced from:
      reqwest::proxy::get_from_platform_impl::h0e968db131db0ba8 in librust_lib_kami.a[arm64][528](reqwest-c9a52ab4bed9e04a.reqwest.1fc08cc0ee706cb6-cgu.13.rcgu.o)
  _kSCPropNetProxiesHTTPSPort, referenced from:
      reqwest::proxy::get_from_platform_impl::h0e968db131db0ba8 in librust_lib_kami.a[arm64][528](reqwest-c9a52ab4bed9e04a.reqwest.1fc08cc0ee706cb6-cgu.13.rcgu.o)
  _kSCPropNetProxiesHTTPSProxy, referenced from:
      reqwest::proxy::get_from_platform_impl::h0e968db131db0ba8 in librust_lib_kami.a[arm64][528](reqwest-c9a52ab4bed9e04a.reqwest.1fc08cc0ee706cb6-cgu.13.rcgu.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Flutter Assemble' from project 'Runner')
** BUILD FAILED **

Building macOS application...                                           
Exception: Build process failed

Is not a 3rd party crate. SC (SystemConfigurtion ) is macos hosted foramework .

cargo build is run success.

failed on flutter run.

I think need modify pod or build script link it (SystemConfigurtion ) to rust_lib.a ?

Looks reasonable to me, IIRC weeks ago someone also solved some errors by adding linking flags.

Please give me some hints, I don't understand macos build process and how pods are used

Thanks .

irondash/cargokit#52 IIRC this one, where people talk about adding -framework SystemConfiguration, and your scenario may (or may not - I have not checked very deeply) have a similar solution

The problem has been resolved

Add SystemConfiguration to Pods -> rust_lib_app -> Frameworks and Libraries

微信截图_20240301174205

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.