---
title: Ditto v4 for Android
slug: v4-4/IY4SiO1YqXSxycrxYUatq
docTags: 
createdAt: 2023-08-22T18:51:23.913Z
---

`kotlin` `android` `updates` `version` `changelog`&#x20;

***

# Kotlin Android Version 4.5.0

:::Changelog{title="Released: Thu Dec 7, 2023"}
::ChangelogItem{type="added" description="New C++ SDK for Android. (#10218)"}

::ChangelogItem{type="added" description="`VERSION` static property to the `Ditto` class. (#10223)"}

::ChangelogItem{type="added" description="`DittoError.FatalError` data class. (#10536)"}

::ChangelogItem{type="added" description="`DittoStore.execute()` method for querying the store using the new Ditto Query Language. (#8354)"}

::ChangelogItem{type="added" description="`DittoSyncSubscription` class for managing sync subscriptions. (#8354, #10536)"}

::ChangelogItem{type="added" description="`DittoSync` class whose `registerSubscription()` method allows for controlling sync using Ditto Query Language. (#8354, #10536)"}

::ChangelogItem{type="added" description="`registerObserver()` method to the `DittoStore` class. (#8354, #10536)"}

::ChangelogItem{type="improved" description="- Deprecated: `DittoLanConfig.multicastEnabled` property. (#10126)"}

::ChangelogItem{type="improved" description="- Deprecated: `DittoError.InternalErrorReason` data class. These very unlikely exceptions will be thrown as `FatalError` instea. (#10536)"}

::ChangelogItem{type="improved" description="Changed: Failure to load the Ditto native binary now throws a `FatalError` instead of aborting the process. (#10015)"}

::ChangelogItem{type="improved" description="Changed: `DittoError.FailedToEncodeValue.error` has been replaced with `FailedToEncodeValue.message` which is a simple string type, reducing API dependency on Jackson/FasterXML. (#10536)"}

::ChangelogItem{type="fixed" description="The Android log level could not be set to a more verbose level at runtime under certain circumstances. (#10786)"}

::ChangelogItem{type="fixed" description="LAN P2P transport fails to stop. (#8809)"}

::ChangelogItem{type="improved" description="Performance by implementing bipartite distance-aware mesh topology. (#10632)"}

::ChangelogItem{type="improved" description="Memory usage and performance of Documents. (#10736)"}

::ChangelogItem{type="improved" description="Reduced metadata accumulation after eviction by clearing remote summaries. (#7065)"}

::ChangelogItem{type="improved" description="-Serialization performance. (#9112)"}

::ChangelogItem{type="fixed" description="-Made logging more robust to failed writes in a specific set of circumstances. (#10077)"}

::ChangelogItem{type="fixed" description="Addressed a warning from SQLite that sometimes occurs on startup about a schema change. (#10501)"}

::ChangelogItem{type="fixed" description="Presence graph may not show all active connections. (#10507)"}

::ChangelogItem{type="fixed" description="When observing peers, isConnectedToDittoCloud property may be incorrect. (#10534)"}

::ChangelogItem{type="fixed" description="Initial logging events now use the same format as all other logs. (#10611)"}

::ChangelogItem{type="fixed" description="Mesh could choose random connections. (#10711)"}

::ChangelogItem{type="fixed" description="A bug with Ditto's internal crash handler. (#10022)"}
:::

# Kotlin Android Version 4.4.5

:::Changelog{title="Released: Fri Nov 17, 2023"}
::ChangelogItem{type="added" description="SDK version/language/platform and device name are now included in the small peer info document. (#10515)"}
:::

# Kotlin Android Version 4.4.4

:::Changelog{title="Released: Thur Nov 2, 2023"}
::ChangelogItem{type="improved" description="Runtime validation of corrupted attachments being inserted into documents &#xA;(#10552)"}

::ChangelogItem{type="fixed" description="An issue introduced in 4.4.2 where the Small Peer Info attachments were not replicated to the Portal. (#10538)"}
:::

# Kotlin Android Version 4.4.3

:::Changelog{title="Released: Tue Oct 24th 2023"}
::ChangelogItem{type="improved" description="Changed: Implemented equals() and hashCode() for DittoAttachmentToken. (#10195)"}
:::

:::CodeblockTabs
installation

```none
implementation "live.ditto:ditto:4.4.3"
```
:::

# Kotlin Android Version 4.4.2

:::Changelog{title="Released: Fri Oct 6th 2023, 12:02 pm"}
::ChangelogItem{type="fixed" description="Small Peer info collection now defaults to localPeerOnly, preventing data from being collected on the Big Peer until the feature is explicitly enabled and sync scope is set to bigPeerOnly. (#10203, #10204)"}

::ChangelogItem{type="fixed" description="Fixed: DittoCollection.upsert() and DittoScopedWriteTransaction.upsert() are now annotated to indicate that they can throw a DittoError (#10109)"}
:::

:::CodeblockTabs
installation

```none
implementation "live.ditto:ditto:4.4.2"
```
:::

# Kotlin Android Version 4.4.1

:::Changelog{title="Released: Tue Sep 26th 2023, 6:39 pm"}
::ChangelogItem{type="improved" description="BLE connection reliability on Android 13. (#10005)"}
:::

:::CodeblockTabs
installation

```none
implementation "live.ditto:ditto:4.4.1"
```
:::

# Kotlin Android Version 4.4.0

:::Changelog{title="Released: Thu Aug 31st 2023, 5:43 pm"}
::ChangelogItem{type="added" description="New smallPeerInfo property to Ditto class for access to the single DittoSmallPeerInfo class instance. (#9704)"}

::ChangelogItem{type="added" description="New DittoSmallPeerInfoSyncScope enum class. The smallPeerInfo collection's sync scope determines which &#x22;kind&#x22; of peers it will replicate to. Defaults to BigPeerOnly. (#9704, #9788)"}

::ChangelogItem{type="added" description="New ValidationError and InternalError classes to help diagnose issues. (#9704)"}

::ChangelogItem{type="added" description="More informative log message for query failures caused by database access errors. (#9364)"}

::ChangelogItem{type="added" description="Small peers now persist structured log data to disk for later retrieval, with limits on the resulting disk usage. (#9547)"}

::ChangelogItem{type="improved" description="Print some internal errors in a more human-readable format. (#9269)"}

::ChangelogItem{type="improved" description="TransportConfig and its associated types can be serialized/deserialized into/from JSON and CBOR. (#9585)"}

::ChangelogItem{type="improved" description="Sets a minimum session refresh period. The small peer will always try to start refreshing its session after 3 days no matter how long the session period issue. Previously the small peer would start to refresh after half of the session length had elapsed. (#9594, #9645)"}

::ChangelogItem{type="improved" description="Initial replication time by reducing one roundtrip of messages before peers can sync. (#9404)"}

::ChangelogItem{type="improved" description="Attachment fetch time in several edge case scenarios. (#9501)"}

::ChangelogItem{type="improved" description="efficiency by using less system resources when connected to peers but no replication changes are needing to be sent. (#9479, #7995)"}

::ChangelogItem{type="improved" description="Significantly reduced startup resource consumption linked to total document count. (#9501)"}

::ChangelogItem{type="fixed" description=" A scenario where a peer could incorrectly receive data back from other peers even after they had modified their subscription and evicted the old data. (#9404)&#xA;"}

::ChangelogItem{type="fixed" description="An issue where unusually high replication write load in large meshes could block all readers from reading the database. (#9395, #8872)&#x22;"}
:::

:::CodeblockTabs
installation

```none
implementation "live.ditto:ditto:4.4.0"
```
:::

# Kotlin Android Version 4.3.1

:::Changelog{title="Released: Thu Aug 10, 2023, 2:22 pm"}
::ChangelogItem{type="improved" description="Changed: Improved clarity of error messages when data on disk cannot be read by this version following a downgrade from a newer version of Ditto. (#9267)"}

::ChangelogItem{type="improved" description="Changed: Print some internal errors in a more human-readable format. (#9495)"}

::ChangelogItem{type="fixed" description="Fixed: an issue that caused excessive multicast traffic over LAN transport. (#9398)"}
:::

:::CodeblockTabs
installation

```none
implementation "live.ditto:ditto:4.3.1"
```
:::

# Kotlin Android Version 4.3.0

:::hint{type="warning"}
This SDK version will migrate some data formats on disk. Once upgraded to 4.3.0, an SDK can only be downgraded back to 4.2.2 and 4.2.1 but no earlier. Downgrading to versions earlier than 4.2.1 will require uninstalling and re-installing to clear out the new data formats. (#8946)
:::

:::Changelog{title="Released: Tue Jul 18, 2023, 10:02 pm"}
::ChangelogItem{type="added" description="Added: Nullable"}

::ChangelogItem{type="added" description="Added: An internal ability to measure & report the level of redundancy in replication updates to calculate the percentage of updates that are arriving from multiple peers. This will be used for future self-balancing mesh actions which are not yet enabled. (#8937)"}

::ChangelogItem{type="improved" description="Changed: new serialization format improves efficiency of replication, particularly in the Big Peer. (#8946)"}

::ChangelogItem{type="improved" description="Changed: Better logging for diagnosing auth failures. (#8984)"}

::ChangelogItem{type="improved" description="Changed: Improved replication performance by introducing a small internal caching layer for commonly computed values. (#8777)"}

::ChangelogItem{type="fixed" description="Fixed: The replication engine can now recover from certain filesystem corruption issues during sync instead of panicking. (#8965)"}

::ChangelogItem{type="fixed" description="Fixed: Increased validation of document updates, preventing updates that try to modify the document id. (#9063)"}
:::

:::CodeblockTabs
installation

```none
implementation "live.ditto:ditto:4.3.0"
```
:::

# Kotlin Android Version 4.2.3

:::Changelog{title="Released: Wed Jul 5th 2023, 3:32 pm"}
::ChangelogItem{type="added" description="Synchronized version bump release"}
:::

:::CodeblockTabs
installation

```none
implementation "live.ditto:ditto:4.2.3"
```
:::

# Kotlin Android Version 4.2.2

:::Changelog{title="Released: Tue Jul 4th 2023, 10:42 am"}
::ChangelogItem{type="improved" description="Improved mesh performance when using 50+ Small Peer devices (#9077)"}

::ChangelogItem{type="improved" description="Changed: Improved deserialization performance of Documents. (#9123)"}

::ChangelogItem{type="improved" description="Changed: Improved reliability of LAN sync when using large numbers of devices. (#8901)"}

::ChangelogItem{type="fixed" description="Fixed: Increased validation of document updates, preventing updates that try to modify the document id. (#9129)"}

::ChangelogItem{type="fixed" description="Fixed: Removed outdated ERROR level log statements in Ditto store related to _id keys being present in CRDT documents. (#9123)"}

::ChangelogItem{type="fixed" description="Fixed: The UpdateDifferentValues write strategy was incorrectly skipping non-alphanumeric document properties. (#9165)"}

::ChangelogItem{type="fixed" description="Fixed: a potential crash if a document attachment was malformed (#9045)"}
:::

:::CodeblockTabs
installation

```none
implementation "live.ditto:ditto:4.2.2"
```
:::

# Kotlin Android Version 4.2.1

:::Changelog{title="Released: Tue Jun 13th 2023, 3:47 pm"}
::ChangelogItem{type="fixed" description="Fixed: a possible crash due to serialisation when upgrading from version 4.1.0 or 4.1.1 (#8925)"}
:::

:::CodeblockTabs
installation

```none
implementation "live.ditto:ditto:4.2.1"
```
:::

# Kotlin Android Version 4.2.0

:::Changelog{title="Released: Tue Jun 13th 2023, 1:53 am"}
::ChangelogItem{type="added" description="Added: Experimental support for disk encryption. This API is experimental for the time being and is likely to change in the next couple of releases. (#8847)"}

::ChangelogItem{type="added" description="Added: login method that provides an extra String? argument (as compared to loginWithToken) that will be non-nil if the auth webhook provided any clientInfo JSON value. The String will be a JSON encoded string. (#8787)"}

::ChangelogItem{type="improved" description="Changed: the existing loginWithToken is marked as deprecated. (#8787)"}

::ChangelogItem{type="improved" description="Changed: Improved replication uses compressed message stream to decrease bandwidth consumption. (#8807)"}

::ChangelogItem{type="improved" description="Changed: Reduce verbosity in replication logs (#8370)"}

::ChangelogItem{type="improved" description="Changed: Improved support for IPv6 Wi-Fi Aware connections (#8518)"}

::ChangelogItem{type="fixed" description="Fixed: Ditto store errors now include more details instead of just an object description. (#8730)"}

::ChangelogItem{type="fixed" description="Fixed: WiFi-Aware P2P connections are now more stable when more than two peers are nearby. (#8598)"}

::ChangelogItem{type="fixed" description="Fixed: Exception TooManyRequests when using WiFi-Aware transport is now handled correctly by the SDK. (#8598)"}
:::

:::CodeblockTabs
installation

```none
implementation "live.ditto:ditto:4.2.0"
```
:::

# Kotlin Android Version 4.1.1

:::Changelog{title="Released: Thu May 18th 2023, 11:35 pm"}
::ChangelogItem{type="fixed" description="Fixed: Devices with hostnames longer than 35 bytes will no longer fail to sync over LAN."}

::ChangelogItem{type="fixed" description="Fixed: Crash when logging out."}
:::

:::CodeblockTabs
installation

```none
implementation "live.ditto:ditto:4.1.1"
```
:::

# Kotlin Android Version 4.1.0

:::Changelog{title="Released: Fri Apr 28th 2023, 11:52 am"}
::ChangelogItem{type="added" description="Added: Disabled replication state. When the Big Peer receives a query that is too big to be satisfied, it will explicitly disable replication with the remote peer, and send a message informing the remote peer that replication is disabled. This is in contrast to the previous behavior, where the Big Peer simply did not respond to the query."}

::ChangelogItem{type="improved" description="Changed: DittoSyncPermissions.contextis now optional for compatibility with Compose apps, which should leverage the Accompanist library for doing permissions check & request"}

::ChangelogItem{type="improved" description="Changed: Ditto instances cannot be closed/deallocated from within a live query callback closure otherwise this can lead to a deadlock."}

::ChangelogItem{type="improved" description="Changed: (Experimental) Query Overlap Groups, Bus: a breaking protocol change for upcoming improvements. Peers using older versions will not be able to connect with newer peers until they upgrade."}

::ChangelogItem{type="fixed" description="Fixed: Improved stability when transferring large updates over Bluetooth LE"}

::ChangelogItem{type="fixed" description="Fixed: A replication issue where certain cases that should have reset the replication session with a remote peer would instead temporarily terminate the connection while not resetting the session."}

::ChangelogItem{type="fixed" description="Fixed: A replication issue that could cause failed convergence on small number of documents if updates are being received during a local eviction."}

::ChangelogItem{type="improved" description="Security: Enforce immediate disconnection of any connected peers whose certificate expires during a sync session."}
:::

:::CodeblockTabs
installation

```none
implementation "live.ditto:ditto:4.1.0"
```
:::

# Kotlin Android Version 4.0.3-alpha.linux-ble-fixes-2

:::Changelog{title="Released: Tue Apr 18th 2023, 1:22 am"}
::ChangelogItem{type="improved" description="Improvements to Bluetooth connection reliability on Linux"}
:::

:::CodeblockTabs
installation

```none
implementation "live.ditto:ditto:4.0.3-alpha.linux-ble-fixes-2"
```
:::

# Kotlin Android Version 4.0.3-alpha.linux-ble-fixes

:::Changelog{title="Released: Mon Apr 17th 2023, 3:19 pm"}
::ChangelogItem{type="fixed" description="Fixed: a replication issue that could cause failed convergence on small number of documents if updates are being received during a local eviction."}

::ChangelogItem{type="improved" description="Improvements to Bluetooth connection reliability on Linux"}
:::

:::CodeblockTabs
installation

```none
implementation "live.ditto:ditto:4.0.3-alpha.linux-ble-fixes"
```
:::

# Kotlin Android Version 4.0.2

:::Changelog{title="Released: Thu Apr 20th 2023, 3:36 pm"}
::ChangelogItem{type="fixed" description="Fixed: A replication issue where certain cases that should have reset the replication session with a remote peer would instead temporarily terminate the connection while not resetting the session."}

::ChangelogItem{type="fixed" description="Fixed: Correct handling of reset and disable errors from receive_update"}
:::

:::CodeblockTabs
installation

```none
implementation "live.ditto:ditto:4.0.2"
```
:::

# Kotlin Android Version 4.0.1

:::Changelog{title="Released: Thu Apr 6th 2023, 11:54 am"}
::ChangelogItem{type="fixed" description="Fixed: Resolved an issue with logging when the stdout is not available."}
:::

:::CodeblockTabs
installation

```none
implementation "live.ditto:ditto:4.0.1"
```
:::

# Kotlin Android Version 4.0.0

:::Changelog{title="Released: Wed Mar 22nd 2023, 3:48 pm"}
::ChangelogItem{type="added" description="Added: AddWins removes will now be used if disableSyncWithV3 has been called on the Ditto object or the a peer has synced with another peer that has called disableSyncWithV3, or they have synced with another peer that has called disableSyncWithV3, etc."}

::ChangelogItem{type="improved" description="Changed: If a problem occurs with an app's authentication webhook, the Small Peer that is trying to authenticate will log more detailed information for the developer."}

::ChangelogItem{type="improved" description="Changed: old multi-hop connections are now automatically disconnected when direct connections are established with peers, freeing up unneeded resources faster."}

::ChangelogItem{type="improved" description="Changed: reduced severity level for some routine log statements which were previously emitted at a WARN level."}

::ChangelogItem{type="fixed" description="Fixed: some threads spawned by the SDK no longer wait up to 30 seconds before being stopped."}

::ChangelogItem{type="fixed" description="Fixed: an issue which could cause Ditto to hang if more than 500 peers were encountered."}

::ChangelogItem{type="fixed" description="Fixed: replication hanging under some circumstances, especially WebSocket connections to Big Peer"}

::ChangelogItem{type="fixed" description="Fixed: potential crash when stopping and restarting WiFi transport very rapidly"}

::ChangelogItem{type="fixed" description="Fixed: attempt to sync with the cloud before the user requests it with"}

::ChangelogItem{type="improved" description="Removed: made a number of erroneously public constants and types internal or private."}
:::

:::CodeblockTabs
installation

```none
implementation "live.ditto:ditto:4.0.0"
```
:::

# Kotlin Android Version 4.0.0-beta1

:::Changelog{title="Released: Thu Jan 26th 2023, 3:37 pm"}
::ChangelogItem{type="fixed" description="Fixed: an issue which could cause Ditto to hang if more than 500 peers were encountered."}

::ChangelogItem{type="fixed" description="Fixed: AddWins removes will now be used if disableSyncWithV3 has been called on the Ditto object or the a peer has synced with another peer that has called disableSyncWithV3, or they have synced with another peer that has called disableSyncWithV3, etc."}
:::

:::CodeblockTabs
installation

```none
implementation "live.ditto:ditto:4.0.0-beta1"
```
:::

# Kotlin Android Version 4.0.0-alpha2

:::Changelog{title="Released: Mon Jan 16th 2023, 2:16 pm"}
::ChangelogItem{type="added" description="Added: disableSyncWithV3 functionality to Ditto. Calling this will permanently remove the ability for the device that it is called on to sync with devices running v3 of the SDK. It also means that the device will then start performing AddWins removes when calling remove(). Any other device running v4 of the SDK that syncs with a device that has called disableSyncWithV3 (or has themselves synced with another device that has called disableSyncWithV3, etc - if any chain of syncing exists that involves a device that has called disableSyncWithV3) will also no longer be able to sync with v3 peers and will perform AddWins removes when calling remove()."}
:::

:::CodeblockTabs
installation

```none
implementation "live.ditto:ditto:4.0.0-alpha2"
```
:::

