Desdaemon / flutter_rust_bridge_template

Template for Flutter + Rust integration with flutter_rust_bridge.
https://desdaemon.github.io/flutter_rust_bridge_template/
Apache License 2.0
119 stars 62 forks source link

Cannot run the sample on IOS Mac M1 #14

Closed kingfisherphuoc closed 2 years ago

kingfisherphuoc commented 2 years ago

I am trying to run the sample project on my MacbookPro M1 (2021). Here's the log:

Launching lib/main.dart on iPhone SE (3rd generation) in debug mode...
Running Xcode build...
Xcode build done.                                            9.7s
Failed to build iOS app
Error output from Xcode build:
↳
    2022-09-16 15:47:25.247 xcodebuild[36640:1961983] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
    2022-09-16 15:47:25.248 xcodebuild[36640:1961983] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
    ** BUILD FAILED **

Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/l4/zwdc70v95vsfqlsnj66kh7fc0000gn/T/flutter_tools.jrgfe8/flutter_ios_build_temp_dirRTpQO9/temporary_xcresult_bundle

    ld: library not found for -lnative_static
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in dependency order

    Result bundle written to path:
        /var/folders/l4/zwdc70v95vsfqlsnj66kh7fc0000gn/T/flutter_tools.jrgfe8/flutter_ios_build_temp_dirRTpQO9/temporary_xcresult_bundle

Error (Xcode): Library not found for -lnative_static

Could not build the application for the simulator.
Error launching application on iPhone SE (3rd generation).

I run it on Android device, it worked well. However, I tried to run it on my Iphone, it did not work. Any idea?

P/s: normal flutter project without rust bridge can be built and run as expected on IPhone.

Desdaemon commented 2 years ago

ld: library not found for -lnative_static

I don't have an iPhone to test this, but it seems that it is not building and/or linking the Rust library.

kingfisherphuoc commented 2 years ago

Well, I was testing the sample rust bridge project with an IOS emulator. I tested no-rust project (dart only), and it was fine before. Is it an issue of M1?

Desdaemon commented 2 years ago

Well, I was testing the sample rust bridge project with an IOS emulator. I tested no-rust project (dart only), and it was fine before. Is it an issue of M1?

It should at least work with the emulator. I'll take a look at this later.

Desdaemon commented 2 years ago

Couldn't reproduce, although I haven't tried emulating the iPhone SE in particular. (I'm also using Mac M1)

kingfisherphuoc commented 2 years ago

@Desdaemon are you using main branch or flutter 3.0 branch?

Desdaemon commented 2 years ago

@Desdaemon are you using main branch or flutter 3.0 branch?

The main branch.

kingfisherphuoc commented 2 years ago

well, I made it by Linking the project manually: http://cjycode.com/flutter_rust_bridge/integrate/ios_linking.html. Using the default value from sample template did not work for me.

Screen Shot 2022-09-17 at 08 50 58