PlatformLoader class

Platform-specific library loader for RunAnywhere core native library (RACommons).

This loader is ONLY responsible for loading the core RACommons library. Backend modules (LlamaCPP, ONNX, etc.) are responsible for loading their own native libraries using their own loaders.

Architecture

  • Core SDK (runanywhere) only knows about RACommons
  • Backend modules are self-contained and handle their own native loading
  • This separation ensures modularity and prevents tight coupling

iOS

XCFrameworks are statically linked into the app binary via CocoaPods. Symbols are available through the process symbol table. In Xcode debug builds, the app code can be linked into Runner.debug.dylib instead of the small launcher executable, so the loader falls back to the executable only after process-wide lookup fails.

Android

.so files are loaded from jniLibs via DynamicLibrary.open().

Constructors

PlatformLoader()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

isAvailable bool
Check if native libraries are available on this platform.
no setter
isCommonsLoaded bool
Check if the commons library is loaded.
no setter
libraryExtension String
Get the current platform's library file extension.
no setter
libraryPrefix String
Get the current platform's library file prefix.
no setter
loadError String?
Get the last load error, if any.
no setter

Static Methods

ensureCloudBackendLoaded() bool
Ensure the cloud-STT backend provider library is loaded so its symbols (rac_backend_cloud_register / rac_backend_cloud_unregister) are resolvable.
loadCommons() DynamicLibrary
Load the RACommons native library.
loadLibrary(String libraryName) DynamicLibrary
Load a native library by name, using platform-appropriate method.
tryLoad() DynamicLibrary?
Try to load the commons library, returning null if it fails.
tryLoadFlutterNativePortHelpers() DynamicLibrary?
Load optional Flutter-owned native-port callback helpers.
unload() → void
Unload library reference.