Releases: Tencent/MMKV
v2.0.1
v2.0.1 / 2024-11-12
This is a hotfix release.
Changes for All platforms
- 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 are listed below. So don't be surprised if you find no update on the unaffected platforms.
HarmonyOS NEXT
- Fix a bug that MMKV might become dead-locked for other threads after
decodeStringSet()
/decodeNumberSet
/decodeBoolSet
or decodingTypedArray
.
Flutter
- Fix the bug on HarmonyOS NEXT listed above. A version named v2.0.1 was added to fix the Android version conflict between the LTS series & v2.0. Thanks to the federated plugins framework, only the underlying
mmkv_ohos
plugin is upgraded, themmkv
plugin stays the same.
POSIX
- Fix a bug that MMKV might become dead-locked for other threads after decoding
std::vector<T>
orstd::span<T>
values.
v1.3.11 LTS
v1.3.11 / 2024-11-12
This is a Long Term Support (LTS) release.
Changes for All platforms
- 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 are listed below. So don't be surprised if you find no update on the unaffected platforms.
HarmonyOS NEXT
- Fix a bug that MMKV might become dead-locked for other threads after
decodeStringSet()
/decodeNumberSet
/decodeBoolSet
or decodingTypedArray
.
Flutter
- Fix the bug on HarmonyOS NEXT listed above. A temp version named v1.3.10 was added to fix the Android version conflict between the LTS series & v2.0. To avoid potential confusion, bump both versions to v1.3.11.
POSIX
- Fix a bug that MMKV might become dead-locked for other threads after decoding
std::vector<T>
orstd::span<T>
values.
v2.0.0
v2.0.0 / 2024-10-21
This release is a breaking change release, especially for Android.
Changes for All platforms
- Add readonly mode support.
- Fix a compile error when
MMKV_DISABLE_CRYPT
is defined and MMKV is built by source in DEBUG.
Android
- Support 16K page size for Android 15.
- Drop the support of 32-bit ABI.
- Bump the mini SDK level to API 23.
iOS / macOS
- Add Mac Catalyst support
Flutter
- Add add log/error/content-change callback.
HarmonyOS NEXT
- Add add log/error/content-change callback.
- Support obfuscation. For the time being, you will have to manually copy the content of MMKV's consumer-rules.txt into your App's obfuscation-rules.txt.
Win32
- Replace
random()
withrand()
to fix a compile error.
v1.3.9 LTS
v1.3.9 / 2024-07-26
This is a Long Term Support (LTS) release.
Changes for All platforms
- Fix a data corruption bug on an encrypted MMKV with only one key value stored.
- Make encryption more resilient from brute force cracking.
- Fix a bug that
pthread_mutex
is not being destroyed correctly.
Android
- Use an alternative way to get the process name to avoid potential App review issues.
- Upgrade to NDK 26.3.11579264.
Flutter
- Add support for HarmonyOS NEXT. In fact, a temp version named v1.3.8 adds this support with the native lib of v1.3.7. To avoid potential confusion, bump both versions to v1.3.9.
v1.3.7 LTS
v1.3.7 / 2024-07-08
Android & Flutter
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.
For other platforms
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.
v1.3.6
v1.3.6 / 2024-07-05
Changes for All platforms
- 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 withstd::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. - The key type changes from
std::string
tostd::string_view
, to avoid unnecessary string construction and destruction when the key is a raw string.
Android
- Use the latest ashmem API if possible.
- Use the latest API to get the device API level.
Flutter
- MMKV will try to load libmmkv.so before Dart code, to reduce the error of loading library in Android.
HarmonyOS NEXT
- Fix a bug that a
String
value might get truncated on encoding. - MMKV returns
undefined
when a key does not exist, previously a default value of the type (false
forboolean
,0
fornumber
, etc) is returned. - Add the feature to encode/decode a
float
value. - Add the feature to encode/decode a
TypedArray
value. - Support encoding a part of an
ArrayBuffer
.
iOS/macOS
- Hide the default
NSObject.initialize()
from Swift/ObjC to prevent potential misuse.
POSIX
- Support encode/decode
std::vector<T>
orstd::span<T>
values, with T as primitive types. - Fix a compile error on Linux env.
- Fix a compile error on the GNU compiler.
- Fix a compile error with some old version of zlib (on CentOS).
Python
- Python now runs on Windows. Check out the latest wiki for instructions.
Windows
- Support encode/decode
std::vector<T>
orstd::span<T>
values, with T as primitive types. - Python now runs on Windows. Check out the latest wiki for instructions.
v1.3.5
v1.3.5 / 2024-04-24
HarmonyOS NEXT
- This is the first official support of HarmonyOS NEXT.
- Most things actually work!
- Checkout the wiki for more.
Flutter
- Migrate to federated plugins to avoid the iOS rename headache. From now on, no more renaming from
mmkv
tommkvflutter
is needed. - Bump iOS Deployment Target to iOS 12.
- Bump Android minSdkVersion to 23.
iOS & macOS
- Avoid using so-called privacy APIs (
lstat()
,fstat()
,NSUserDefaults
). - Bump iOS Deployment Target to iOS 12.
Android
- Bump minSdkVersion to 23.
- Drop armv7 & x86 support.
POSIX
- Use the embedded libz when libz can not be found.
- Fix compile error when building with gcc.
Windows
- Support x64 architecture.
v1.3.4
v1.3.3
v1.3.3 / 2024-01-25
Changes for All platforms
- Add
removeStorage()
static method to safely delete underlying files of an MMKV instance. - Add protection from a potential crash of a multi-process MMKV loading due to the MMKV file not being valid.
- Add back the lazy load feature. It was first introduced in v1.2.16. But it was rollbacked in v1.3.0 of potential ANR & file corruption. Now it's clear that the bug was caused by something else, it's time to bring it back.
- Optimize loading speed by using shared inter-process lock unless there's a need to truncate the file size, which is rare.
- Make these two lately added features more robust: customizing the initial file size & optimizing write speed when there's only one key inside MMKV.
Android
- Fix a bug that
null
is returned when the value is in fact an empty ByteArray. - Fix AGP >= 8 package namespace error.
- Fix the
FastNative
naming conflict. - Upgrade to SDK 34.
- Upgrade
androidx.annotation
to v1.7.1.
iOS & macOS
- On the Xcode 15 build, an App will crash on iOS 14 and below. Previously we have recommended some workarounds (check the v1.3.2 release note for details). Now you can use Xcode 15.1 to fix this issue.
- Fix a bug that the multi-process mode won't configure correctly. It was introduced in v1.3.2.
- Fix a macro naming conflict.
- Avoid using a so-called privacy API when creating temp files.
POSIX
- Fix a compile error on
memcpy()
.
Golang
- Fix a compile error when
MMKV_DISABLE_CRYPT
is on.
v1.3.2
v1.3.2 / 2023-11-20
Among most of the features added in this version, the credit goes to @kaitian521.
Changes for All platforms
- Add the feature of customizing the initial file size of an MMKV instance.
- Optimize write speed when there's only one key inside MMKV, the new key is the same as the old one, and MMKV is in
SINGLE_PROCESS_MODE
. - Optimize write speed by overriding from the beginning of the file instead of append in the back, when there's zero key inside MMKV, and MMKV is in
SINGLE_PROCESS_MODE
. - Add the feature of
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. - Add the feature of comparing values before setting/encoding on the same key.
- Fix a potential bug that the MMKV file will be invalid state after a successful expansion but a failure
zeroFill()
, will lead to a crash. - Fix a potential crash due to other module/static lib turn-off RTTI, which will cause MMKV to fail to catch
std::exception
. - Fix several potential crashes due to the MMKV file not being valid.
Android
- Use the
-O2
optimization level by default, which will reduce native lib size and improve read/write speed a little bit. - Experimantal use
@fastNative
annotation onenableCompareBeforeCompare()
to speed up JNI call.
iOS & macOS
- Optimize auto-clean logic to reduce lock waiting time.
- Turn-off mlock() protection in background on iOS 13+. We have verified it on WeChat that the protection is no longer needed from at least iOS 13. Maybe iOS 12 or older is also not needed, but we don't have the chance to verify that because WeChat no longer supports iOS 12.
Known Issue
- On Xcode 15 build, the App will crash on iOS 14 and below. The bug is introduced by Apple's new linker. The official solutions provided by Apple are either:
- Drop the support of iOS 14.
- Add
-Wl,-weak_reference_mismatches,weak
or-Wl,-ld_classic
options to theOTHER_LDFLAGS
build setting of Xcode 15. Note that these options are not recognized by older versions of Xcode. - Use older versions of Xcode, or wait for Xcode 15.2.