- Flutter
- Rust nightly
- Icons are generated using https://pub.dev/packages/flutter_launcher_icons
- Configuration is at the bottom of
app/pubspec.yaml
cd app
flutter pub get
flutter pub run flutter_launcher_icons
From app
directory.
flutter_rust_bridge_codegen \
-r native/src/api.rs \
-d lib/bridge_generated.dart \
-c ios/Runner/bridge_generated.h \
-e macos/Runner/
On Fedora Silverblue:
set -x CPATH "$(clang -v 2>&1 | grep "Selected GCC installation" | rev | cut -d' ' -f1 | rev)/include"
flutter_rust_bridge_codegen --llvm-path /usr/lib64/libclang.so.14.0.0 \
-r native/src/api.rs \
-d lib/bridge_generated.dart \
-c ios/Runner/bridge_generated.h \
-e macos/Runner/
cd app
flutter create --platforms=ios .
cargo install -f cargo-xcode
cargo install -f [email protected]
rustup target add aarch64-apple-ios
- Follow Flutter Rust bridge setup for iOS1
- Modify how Xcode strips symbols2
- In Xcode, go to Target Runner > Build Settings > Strip Style.
- Change from All Symbols to Non-Global Symbols.
cd app
flutter create --platforms=macos .
cargo install -f cargo-xcode
cargo install -f [email protected]
- Follow Flutter Rust bridge setup for Mac1
- Instead of dylib as suggested in the guide I am linking static lib (just like on iOS)
- Under Signing & Capabilities
- Check "Outgoing connections" for both Debug and Release profiles
- Modify how Xcode strips symbols2
- In Xcode, go to Target Runner > Build Settings > Strip Style.
- Change from All Symbols to Non-Global Symbols.
cd app
flutter create --platforms=android .
cargo install -f cargo-ndk
cargo install -f [email protected]
rustup target add \
aarch64-linux-android \
armv7-linux-androideabi \
x86_64-linux-android
-
In Android Studio also install:
- Android SDK Command-line Tools
- NDK
-
Follow Flutter Rust bridge setup for Android3
- Or see their sample project4
- Add to
~/.gradle/gradle.properties
(using absolute path is a requirement):ANDROID_NDK=/var/home/roman/Android/Sdk/ndk/25.0.8775105
Mac:ANDROID_NDK=/Users/roman/Library/Android/sdk/ndk/25.1.8937393
You have two options:
- Either clear debug signing config not to use release keystore
- Or set up keystore (see "Android: First time setup" section in
RELEASE.md
)
Footnotes
-
https://cjycode.com/flutter_rust_bridge/integrate/ios.html ↩ ↩2
-
https://docs.flutter.dev/development/platform-integration/ios/c-interop#stripping-ios-symbols ↩ ↩2
-
https://cjycode.com/flutter_rust_bridge/integrate/android_tasks.html ↩
-
https://github.com/Desdaemon/flutter_rust_bridge_template/blob/main/android/app/build.gradle ↩