sdk/runanywhere-flutter/docs/DEVELOPMENT.md
This guide covers platform setup, building from source, and contributor workflows. For integration instructions, see the consumer README.
| Tool | Version |
|---|---|
| Flutter | 3.44+ (workspace constraint is >=3.44.0; validated on 3.44.6) |
| Dart | Matches workspace pubspec.yaml (>=3.12.0 <4.0.0) |
| Xcode | 26+ (iOS builds) |
| Android Studio | with NDK 28.2.13676358 |
| CMake | 3.24+ |
After adding the packages, update your iOS Podfile:
1. Update ios/Podfile:
platform :ios, '17.5'
target 'Runner' do
use_frameworks! :linkage => :static
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '17.5'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
'PERMISSION_MICROPHONE=1',
]
end
end
end
Important: Without
use_frameworks! :linkage => :static, you will see "symbol not found" errors at runtime.
2. Update ios/Runner/Info.plist:
<key>NSMicrophoneUsageDescription</key>
<string>This app needs microphone access for speech recognition</string>
3. Run pod install:
cd ios && pod install && cd ..
Add microphone permission to android/app/src/main/AndroidManifest.xml:
<uses-permission android:name="android.permission.RECORD_AUDIO" />
The SDK depends on native C++ libraries from runanywhere-commons.
# 1. Clone the repository
git clone https://github.com/RunanywhereAI/runanywhere-sdks.git
cd runanywhere-sdks
# 2. Build native artifacts (from repo root)
./sdk/runanywhere-swift/scripts/build-core-xcframework.sh
./scripts/build/build-core-android.sh arm64-v8a
# 3. Bootstrap the Flutter workspace
cd sdk/runanywhere-flutter
melos bootstrap
What the build scripts do:
build-core-xcframework.sh builds and stages XCFrameworks into each package's ios/<package>/Frameworks/ directory.build-core-android.sh <ABI> builds .so libraries and stages them into android/src/main/jniLibs/<ABI>/.| Mode | Description |
|---|---|
| Source checkout | Android uses staged JNI when runanywhere.useLocalNatives=true; Apple packages prefer staged Frameworks/. |
| Published package | Pub archives omit native payloads. Android Gradle downloads per-ABI archives with SHA-256 verification. CocoaPods/SwiftPM download pinned checksums for Apple plugins. |
cd ../../examples/flutter/RunAnywhereAI
flutter pub get
cd ios && pod install && cd ..
flutter run
The sample app's pubspec.yaml uses path dependencies to reference the local SDK packages.
After modifying Dart SDK code: changes are picked up automatically when you run flutter run.
After modifying runanywhere-commons (C++ code):
# From repo root
./sdk/runanywhere-swift/scripts/build-core-xcframework.sh
./scripts/build/build-core-android.sh arm64-v8a
| Script | Description |
|---|---|
sdk/runanywhere-swift/scripts/build-core-xcframework.sh | iOS: builds/stages package-owned XCFrameworks |
scripts/build/build-core-android.sh <ABI> | Android: builds backend .so files into Flutter packages |
sdk/runanywhere-flutter/scripts/package-sdk.sh | Validate all packages via pub publish --dry-run |
The RunAnywhere Flutter SDK uses a modular architecture with a C++ commons layer accessed via FFI:
┌─────────────────────────────────────────────────────────────────┐
│ Your Flutter Application │
├─────────────────────────────────────────────────────────────────┤
│ RunAnywhere (llm, stt, tts, vad, vlm, voice, models, ...) │
├─────────────────────────────────────────────────────────────────┤
│ Native Bridge Layer (FFI) │
├───────────┬───────────┬───────────┬─────────────────────────────┤
│ LlamaCpp │ Apple MLX │ ONNX │ QHexRT (optional NPU) │
└───────────┴───────────┴───────────┴─────────────────────────────┘
See also Documentation.md and ARCHITECTURE.md.
dart format lib/ test/
flutter analyze
dart fix --apply
git checkout -b feature/my-featureflutter testflutter analyzeuse_frameworks! :linkage => :static in Podfilecd ios && pod install --repo-updateflutter clean && flutter runjniLibs folder contains .so files./scripts/build/build-core-android.sh <ABI> from the repo rootOpen an issue on GitHub with:
RunAnywhere.versionflutter --version