constructDittoFallible

fun constructDittoFallible(dependencies: DittoDependencies, identity: DittoIdentity = OfflinePlayground(dependencies), coreExceptionBridgingEnabled: Boolean = false): Ditto

Deprecated

Use Ditto.open() instead, providing the coreExceptionBridgingEnabled via DittoConfig.experimental.

Replace with

Ditto.open(config)

Constructs a Ditto instance in a new way that prevents a crash if the rust core has a problem obtaining a lock on the persistence directory. Should an issue occur, this method instead throws a DittoError.

Parameters

coreExceptionBridgingEnabled

sets whether core crashes (panics) should be raised as JVM exceptions. To get a full readable stack trace from the core crash, you need to ensure debug symbols are not stripped during the build. You can do that from gradle:

android {
...
packagingOptions{
jniLibs {
useLegacyPackaging = true
keepDebugSymbols.add("**\/libdittoffi.so")
}
}
}

Whilst enabling coreExceptionBridging, in and of itself, does not affect binary size nor performance, do note that keeping the debug symbols (as shown) ought only to be done for Debug builds, since it may result in an increase of the size of the app by ~30MB.

Throws

if there was a problem constructing the Ditto instance.

if the given persistence directory is in use by another Ditto instance.