checkAbiVersion static method
void
checkAbiVersion(
- String libName,
- int readVersion()
)
Implementation
static void checkAbiVersion(String libName, int Function() readVersion) {
late final int actual;
try {
actual = readVersion();
} catch (error) {
throw StateError(
'$libName: Nitro ABI version check failed. Run `nitrogen generate` '
'and `nitrogen link`, then rebuild the WASM module '
'(web/build_web.sh). Details: $error',
);
}
if (actual != expectedAbiVersion) {
throw StateError(
'$libName: Nitro ABI version mismatch. Dart runtime expects '
'$expectedAbiVersion but the WASM bridge reports $actual. Run '
'`nitrogen generate`, rebuild the WASM module, and rebuild the app.',
);
}
}