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 via DynamicLibrary.executable() which can find both global and local symbols in the main executable.

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
isLoaded bool
Legacy: Check if any native 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

load() DynamicLibrary
Legacy method for backward compatibility. Loads the commons library by default.
loadCommons() DynamicLibrary
Load the RACommons native library.
loadLibrary(String libraryName) DynamicLibrary
Load a native library by name, using platform-appropriate method.
loadNativeLibrary() DynamicLibrary
Convenience alias for load().
tryLoad() DynamicLibrary?
Try to load the commons library, returning null if it fails.
unload() → void
Unload library reference.