NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev
pub.dev, #1935 most downloaded on pub.dev
An efficient, small mobile key-value storage framework developed by WeChat. Works on Android & iOS.
Latest stable
2.4.3
Last release 1 months ago
16 Oct 2026
Ships fairly regularly
a new release about every 2 months
Most releases are documented
notes for 37 of 45 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
45 releases · first in 2018
Drag across the ruler to compare, or tap a release to open it.
This is a bugfix release based on v2.4.2, focused on encryption, expiration, imports, and file recovery. It also adds Android KMP initialization witho
This is a bugfix release based on v2.4.2, focused on encryption, expiration, imports, and file recovery. It also adds Android KMP initialization without an explicit Context and non-expired-key enumeration on Apple platforms.
Upcoming compatibility change: The release after v2.4.3 will raise the minimum supported versions from iOS 13.0 to iOS 15.0 and from watchOS 6.0 to watchOS 9.0, to align with Xcode 27's supported deployment targets. The minimum deployment targets in v2.4.3 remain unchanged.
importFrom() (#1688) and removeStorage(). Callers must still prevent concurrent use of an instance being removed.MMKV.initialize() without an explicit Context using AndroidX App Startup. Explicit Context initialization remains available.enumerateKeys: safe when callbacks read expired values.enumerateNonExpiredKeys: to filter expired keys at the start of enumeration.libmmkv.so is unavailable for the device ABI (#1687).sendfile() transfers.Your coding agent can read these notes before it upgrades. Set up the MCP server →
This is a hotfix release based on v2.4.1. It adds targeted encrypted-write and backup/restore checks, fixes Kotlin Multiplatform consistency issues, a
This is a hotfix release based on v2.4.1. It adds targeted encrypted-write and backup/restore checks, fixes Kotlin Multiplatform consistency issues, and repairs native package build/link regressions.
.crc.PBUtility.h include its MMBuffer dependency directly.This is a maintenance release based on v2.4.0. It focuses on data-safety fixes, encrypted-file compatibility, packaging/build cleanup, and experimenta
This is a maintenance release based on v2.4.0. It focuses on data-safety fixes, encrypted-file compatibility, packaging/build cleanup, and experimental Kotlin Multiplatform support for Android and iOS.
close() semantics.uint16_t holder limit could overflow key/value metadata and corrupt subsequent reads.expireDuration overflow bug (#1665). Very large expiration durations are now clamped safely instead of wrapping around.-Wmissing-braces warnings in Android, Win32, and POSIX demo code.Core/cbridge) for MMKV Core, with NameSpace support and a pure C demo. The C bridge is also used by the KMP iOS package.com.tencent:mmkv-kmp:2.4.1. The API and artifact layout may change in a future release.iosArm64, iosSimulatorArm64, and iosX64.com.tencent:mmkv:2.4.1 AAR. iOS embeds MMKV Core through the C bridge in the published native KLIBs.close() semantics.ANDROID_ABI is defined, including local Android artifact publication builds.MMKVAppExtension-static.+[MMKV unregisterHandler] as the correctly spelled handler-unregistration API. The previous typo'd +unregiserHandler remains available for source/binary compatibility and forwards to the new API.close() semantics.@tencent/mmkv package metadata and documentation for v2.4.1.close() semantics.-Wmissing-braces warnings in Win32 file handling code.Change: Merged MMKVContentChangeNotification into MMKVHandler. The old MMKVContentChangeNotification interface is now @Deprecated.
This release introduces a unified MMKVHandler callback interface across all platforms, replacing scattered per-callback registration with a single, OO-style handler. It also adds the MMKVConfig all-in-one configuration and several bug fixes.
MMKVHandler interface. All callbacks (log redirecting, error handling, content change notification, content loaded notification) are now grouped in a single handler registered via registerHandler(). The old per-callback registerLogHandler() / registerErrorHandler() / registerContentChangeHandler() / registerContentLoadedHandler() APIs have been removed.onMMKVContentLoadSuccessfully callback, triggered when an MMKV file is loaded/mapped successfully.MMKVConfig for all-in-one instance configuration, supporting all options (mode, cryptKey, aes256, expectedCapacity, enableKeyExpire, expiredInSeconds, enableCompareBeforeSet, recover, itemSizeLimit) in a single struct/class.defaultMMKV(config) variant for creating the default instance with full configuration.delete file failure on corrupted files.m_file not valid for isDiskOfMMAPFileCorrupted().absolutePath() calls as much as possible.MMKVContentChangeNotification into MMKVHandler. The old MMKVContentChangeNotification interface is now @Deprecated.fcntl() OFD lock failure on ashmem (#1637).expectedCapacity.getBytes() with string_view key for ObjC++.NameSpace instance.tryAtomicRename().expectedCapacity.MMKVHandler callback interface.This release is a breaking change and introduces AES-256 encryption for enhanced security.
This release is a breaking change and introduces AES-256 encryption for enhanced security.
reKey() method with the new key and set the aes256 parameter to true, e.g., reKey(newKey, aes256=true). After this, you should use the new key for all future loads of this instance.ReadOnly mode.weakly_canonical() exception caused by an invalid file path.armv7k to the "Excluded Architectures" setting for your Apple Watch App or Extension target.armv7k support.relativePath: parameter. If you were using these methods, please migrate to those using the rootPath: parameter instead.armv7 support.This is a hotfix release mainly for iOS/macOS CocoaPods users.
This is a hotfix release mainly for iOS/macOS CocoaPods users.
This is a feature release that brings full desktop support to Flutter. It also includes key bug fixes and enhancements for Android and other platforms
This is a feature release that brings full desktop support to Flutter. It also includes key bug fixes and enhancements for Android and other platforms.
MMKVHandler.getNativeLogHandler() to allow native handling of MMKV logs from C++ code, improving performance.Long.MAX_VALUE was misinterpreted as a negative number.MMKV_APPLE flag was not set.This is a hot fix version mainly for Android/Linux platforms. It’s highly recommended for v2.2.0~v2.2.1 users.
This is a hot fix version mainly for Android/Linux platforms. It’s highly recommended for v2.2.0~v2.2.1 users.
## v2.2.1 / 2025-04-25 ### Changes for All platforms * Add importFrom(). ### Android * Fix a bug on initialization.
importFrom().Drop deprecated armv7 AES hardware acceleration.
We introduce the Mayfly FD (short-lived file descriptor) enhancement, reducing MMKV's fd footprint by half and more. For a single-process mode MMKV instance, the fd footprint is reduced to zero (except Android/OHOS, details below). For a multi-process mode MMKV instance, the fd footprint is reduced by half, for we still need a long-lived fd to inter-process lock the shared memory.
checkExist() to check if a MMKV instance exists on disk.checkProcessMode(), it’s never been used.+mmkvGroupPath to get the group folder for MMKV multi-process storage.Nothing published for this version
Happy Chinese New Year! This is a breaking change version for the Android/OHOS platform. Read the change log bellow and upgrade carefully.
Happy Chinese New Year!
This is a breaking change version for the Android/OHOS platform. Read the change log bellow and upgrade carefully.
NameSpace feature that easily supports customizing a root directory.ReadOnly mode.NameSpace feature. Starting from v2.1.0, MMKV will try to migrate them back to normal when possible.F_OFD_SETLK instead of F_SETLK.NameSpace feature. Starting from v2.1.0, MMKV will try to migrate them back to normal when possible.F_OFD_SETLK instead of F_SETLK.NameSpace functionality.mlock() protection given that we are iOS 13+.F_OFD_SETLK instead of F_SETLK.Mary holiday and a happy new year!
Mary holiday and a happy new year!
For all those who suffer from incorrect file names in Android/OHOS, we are planning a new feature called NameSpace, specifically, and will solve this problem once and for all. Under this feature, a previously incorrect file name will be migrated to the correct file name under a custom root path.
However, this also means that once upgraded, the file will no longer be accessed by older versions of MMKV/your App, which will be a problem if your team member or your users do some downgrade operation. To address this issue, we have provided a forward support version of MMKV that supports reading upgraded/correct file names, and it's released as v2.0.2.
So please upgrade to v2.0.2 and get prepared for this shiny new feature NameSpace.
UnsupportedArchitectureException) before trying to load native lib.mmap() on ftruncate()/zeroFillFile() failure iff we have a valid file mapping before.Fix a bug that might cause MMKV to become dead-locked for other threads after decoding container-type values. The affected platforms and value types a
This is a hotfix release.
decodeStringSet() / decodeNumberSet / decodeBoolSet or decoding TypedArray.mmkv_ohos plugin is upgraded, the mmkv plugin stays the same.std::vector<T> or std::span<T> values.This release is a breaking change release, especially for Android.
This release is a breaking change release, especially for Android.
MMKV_DISABLE_CRYPT is defined and MMKV is built by source in DEBUG.random() with rand() to fix a compile error.This is a Long Term Support (LTS) maintenance release.
This is a Long Term Support (LTS) maintenance release.
This is a Long Term Support (LTS) release.
This is a Long Term Support (LTS) release.
This is a Long Term Support (LTS) release.
This is a Long Term Support (LTS) release.
decodeStringSet() / decodeNumberSet / decodeBoolSet or decoding TypedArray.std::vector<T> or std::span<T> values.Nothing published for this version
This is a Long Term Support (LTS) release.
This is a Long Term Support (LTS) release.
pthread_mutex is not being destroyed correctly.Nothing published for this version
This Long Term Support (LTS) release primarily reintroduces support for the ARMv7 architecture and lowers the minimum SDK version requirement to 21. P
This Long Term Support (LTS) release primarily reintroduces support for the ARMv7 architecture and lowers the minimum SDK version requirement to 21. Please note that only critical bug fixes will be applied to the 1.3.x series. New features will be introduced in version 2.0 and later, which will discontinue support for 32-bit architectures and raise the minimum SDK version requirement to 23.
This is exactly the same as v1.3.6, so don't be surprised if you don't see this version in CocoaPods or OHPM.
The Core library now upgrades the C++ standard from C++17 to C++20 to make the most of morden C++ feature such as Concept & unordered containers with
Concept & unordered containers with std::string_view as key. From now on, if you build MMKV by source (iOS, Windows, POSIX, etc), you will need a C++ compiler that supports the C++20 standard. If you only use MMKV in binary (Android, OHOS, etc), this upgrade of the C++ compiler is not required.std::string to std::string_view, to avoid unnecessary string construction and destruction when the key is a raw string.String value might get truncated on encoding.undefined when a key does not exist, previously a default value of the type (false for boolean, 0 for number, etc) is returned.float value.TypedArray value.ArrayBuffer.NSObject.initialize() from Swift/ObjC to prevent potential misuse.std::vector<T> or std::span<T> values, with T as primitive types.std::vector<T> or std::span<T> values, with T as primitive types.This is the first official support of HarmonyOS NEXT.
mmkv to mmkvflutter is needed.lstat(), fstat(), NSUserDefaults).Make trim() more robust in multi-process mode.
trim() more robust in multi-process mode.::unlink().Add removeStorage() static method to safely delete underlying files of an MMKV instance.
removeStorage() static method to safely delete underlying files of an MMKV instance.null is returned when the value is in fact an empty ByteArray.FastNative naming conflict.androidx.annotation to v1.7.1.memcpy().MMKV_DISABLE_CRYPT is on.Among most of the features added in this version, the credit goes to @kaitian521.
Among most of the features added in this version, the credit goes to @kaitian521.
SINGLE_PROCESS_MODE.SINGLE_PROCESS_MODE.clearAll() with keeping file disk space unchanged, reducing the need to expand file size on later insert & update operations. This feature is off by default, you will have to call it with relative params or newly added methods.zeroFill(), will lead to a crash.std::exception.-O2 optimization level by default, which will reduce native lib size and improve read/write speed a little bit.@fastNative annotation on enableCompareBeforeCompare() to speed up JNI call.-Wl,-weak_reference_mismatches,weak or -Wl,-ld_classic options to the OTHER_LDFLAGS build setting of Xcode 15. Note that these options are not recognized by older versions of Xcode.This is a hotfix version. It's highly recommended that v1.2.16 & v1.3.0 users upgrade as soon as possible.
This is a hotfix version. It's highly recommended that v1.2.16 & v1.3.0 users upgrade as soon as possible.
count() & allKeys() methods when auto key expiration is turn on.msync() call on newly created MMKV instances.Add auto key expiration feature. Note that this is a breaking change, once upgrade to auto expiration, the MMKV file is not valid for older versions o…
Nothing published for this version
Optimization: The actual file content is lazy loaded now, saving time on MMKV instance creation, and avoiding lock waiting when a lot of instances are
Log handler register method is now deprecated. It's integrated with initialize().
initialize().lock()/unlock()/try_lock() is not thread-safe.sdkInt, avoid unnecessary risk on Android App Review.+[MMKV initializeMMKV:] manually before calling any MMKV methods.Fix a bug that MMKV.getXXX() may return invalid results in multi-process mode.
MMKV.getXXX() may return invalid results in multi-process mode.[] instead of null on empty StringSet from MMKV.decodeStringSet() methods.32.-[MMKV getObject:forKey:] method when the key-value doesn't exist.Fix crash on using Ashmem while MMKV_DISABLE_CRYPT macro is defined.
MMKV_DISABLE_CRYPT macro is defined.-[MMKV getXXX:forKey:hasValue:] methods.MMKV::getXXX(key, defaultValue, hasValue) methods.MMKV::getXXX(key, defaultValue, hasValue) methods.Fix a bug that a subsequential clearAll() call may fail to take effect in multi-process mode.
clearAll() call may fail to take effect in multi-process mode.compileSdkVersion & targetSdkVersion from 30 to 31.Due to increasing report about crash inside STL, we have decided to make MMKV static linking libc++ by default. Starting from v1.2.11, com.tencent:mmk
libc++ by default. Starting from v1.2.11, com.tencent:mmkv-static is the same as com.tencent:mmkv.libc++_shared, you could use com.tencent:mmkv-shared instead.Mark MMKV.commit() & MMKV.apply() as deprecated, to avoid some misuse after migration from SharedPreferences to MMKV.
This version is mainly for Android & Flutter.
MMKV.mmkvWithID() from returning null to throwing exceptions on any error.MMKV.actualSize() to get the actual used size of the file.MMKV.commit() & MMKV.apply() as deprecated, to avoid some misuse after migration from SharedPreferences to MMKV.This version is mainly for Android & Flutter.
This version is mainly for Android & Flutter.
libc++, we have decided to upgrade MMKV's building NDK in this release. That means we can't support armeabi anymore. Those who still in need of armeabi can build from sources by following the instruction in the wiki.We really appreciate your understanding.
MMKV.encodeString() with an empty string value on Android, MMKV.decodeString() will return null.MMKV.defaultMMKV() on Android might fail to load, you can try calling MMKV.defaultMMKV(cryptKey: '\u{2}U') with an encrytion key '\u{2}U' instead.This will be the last version that supports armeabi arch on Android. To avoid some crashed on the old NDK (r16b), and make the most of a more stable l
This will be the last version that supports armeabi arch on Android. To avoid some crashed on the old NDK (r16b), and make the most of a more stable libc++, we have decided to upgrade MMKV's building NDK in the next release. That means we can't support armeabi anymore.
We really appreciate your understanding.
MMKV.disableProcessModeChecker(). There are some native crash reports due to the process mode checker. You can disable it manually.MMKV.initialize() to customize the root directory, a context parameter is required now.encodeString() with an empty string value.Known Issue on Flutter
encodeString() with an empty string value on Android, decodeString() will return null. This bug will be fixed in the next version of Android Native Lib. iOS does not have such a bug.Fix a bug when calling sync() with false won't do msync() asynchronous and won't return immediately.
Happy holidays everyone!
sync() with false won't do msync() asynchronous and won't return immediately.putStringSet() with null.MMKV.initialize() with both Context and LibLoader parammeters.Add golang for POSIX platforms. Most things actually work!. Check out the wiki for information.
Fix a file corruption when calling reKey() after removeKeys() has just been called.
reKey() after removeKeys() has just been called.MMKV_DISABLE_CRYPT is set.MMKV_DISABLE_FLUTTER to disable flutter plugin features. If you integrate MMKV by source code, and if you are pretty sure the flutter plugin is not needed, you can turn that off to save some binary size.Add MMKV support for Flutter on iOS & Android platform. Most things actually work!
Check out the wiki for more info.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.