Tencent / MMKV

An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, and POSIX.
Other
17.3k stars 1.9k forks source link

最新版本1.3.5 #1338

Closed minorlai closed 2 months ago

minorlai commented 3 months ago

Note:

An crash issue will be ignored & closed in a week without logs.

The language of MMKV

e.g. Objective-C, Swift, Java, or Kotlin

Kotlin

The version of MMKV

e.g. v1.2.2
Note: For versions older than the latest version, please upgrade before posting any issue.
We don't have much time for old version tech support.

v1.3.5

The platform of MMKV

e.g. iOS or Android

Android

The installation of MMKV

e.g. Cocoapods, Maven, or Git clone

Maven

What's the issue?

Post the outputs or screenshots for errors.

Explain what you want by example or code in English. If you have a crash/OOM/ANR on Android, please provide symbolize stack traces. https://developer.android.com/ndk/guides/ndk-stack.html

What's the log of MMKV when that happened?

Your detail logs. As much as possible. For how to forward MMKV's log, you can checkout the wiki on each platform. An crash issue will be ignored & closed in a week without logs.

步骤:application oncreate 初始化mmkv后,在SplashActivity使用mmkv,出现以下错误: Fatal Exception: java.lang.UnsatisfiedLinkError dlopen failed: library "libmmkv.so" not found java.lang.Runtime.loadLibrary0 (Runtime.java:1077)

java.lang.System.loadLibrary (System.java:1656) com.tencent.mmkv.MMKV.doInitialize (MMKV.java:223) com.tencent.mmkv.MMKV.initialize (MMKV.java:205) com.tencent.mmkv.MMKV.initialize (MMKV.java:91) com.talk.inapp.app.TalkInApp.initCache (TalkInApp.kt:90) com.talk.inapp.app.TalkInApp.onCreate (TalkInApp.kt:54) android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1223)

com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1009)

原本使用1.3.2的版本不会出现这个错误,更新后出现的

lingol commented 3 months ago

Your case is complicated. Please provide a reproducible demo project.

jzlhll commented 3 months ago

1.3.5+ drop x86 and armV7.

lingol commented 3 months ago

1.3.5+ drop x86 and armV7.

That's a possible reason. You can verify that by upgrading just to v1.3.4 and check if it crashes or not.

lingol commented 2 months ago

v1.3.7 LTS has just been release.

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.

minorlai commented 2 months ago

更新至 1.3.7的版本后,依然存在闪退问题 image

lingol commented 2 months ago

@minorlai Have you looked at your crash carefully? Yours is a totally different issue, misusing armv7 for arm64.

image
minorlai commented 2 months ago

@minorlai Have you looked at your crash carefully? Yours is a totally different issue, misusing armv7 for arm64. image

gradle配置: ndk { abiFilters "arm64-v8a","armeabi-v7a" } 错误是线上用户统计到的,自己的设备没办法复现

lingol commented 2 months ago

Have you tried ReLinker as the FAQ suggested?

minorlai commented 2 months ago

@lingol 没有尝试其他,请问我该如何调整呢?针对的线上用户都是海外用户,是否海外机型兼容方面会不一样?

lingol commented 2 months ago

@lingol

没有尝试其他,请问我该如何调整呢?针对的线上用户都是海外用户,是否海外机型兼容方面会不一样?

I thought I just said, follow the FAQ.

minorlai commented 2 months ago

@lingol 没有尝试其他,请问我该如何调整呢?针对的线上用户都是海外用户,是否海外机型兼容方面会不一样?

I thought I just said, follow the FAQ.

我退回 1.3.4的版本,再观察问题

minorlai commented 2 months ago

@lingol 已经升级1.3.9,试了1.3.4/1.3.5/1.3.7/1.3.9 多个版本,依然出现错误 image 项目配置的ndk是 ndk { abiFilters "arm64-v8a","armeabi-v7a" }

lingol commented 2 months ago

Have you tried ReLinker as the FAQ suggested?

minorlai commented 1 month ago

Have you tried ReLinker as the FAQ suggested?

已经尝试Relinker 库去做兼容,但是出现另一个错误 image

lingol commented 1 month ago

OK, now looks like something is wrong with your package. The libmmkv.so is absolutely missing in the APK/Android App Bundles.

In your original issue you mention that this problem occurs when you upgrade from v1.3.2. Are there other changes on the project along side with the upgrade of MMKV that you have failed to notice that cause this problem? To verify that, you can try this: downgrade MMKV to v1.3.2 with other changes (including ReLinker) untouched, and see if the problem still exists. If the problem still exists, then it's not the MMKV upgrade that caused the problem, it's other changes you or your team made cause it.

minorlai commented 1 month ago

OK, now looks like something is wrong with your package. The libmmkv.so is absolutely missing in the APK/Android App Bundles.

In your original issue you mention that this problem occurs when you upgrade from v1.3.2. Are there other changes on the project along side with the upgrade of MMKV that you have failed to notice that cause this problem? To verify that, you can try this: downgrade MMKV to v1.3.2 with other changes (including ReLinker) untouched, and see if the problem still exists. If the problem still exists, then it's not the MMKV upgrade that caused the problem, it's other changes you or your team made cause it.

你好,我把版本退回1.3.2/1.3.4 依然出现错误,而且影响的用户人数更多了,错误如下: image

lingol commented 1 month ago

And it's confirmed that it is not a MMKV issue but something else you or your team have done that caused the problem.

minorlai commented 1 month ago

你好,根据异常日志 Could not find 'libmmkv.so'. Looked for: [arm64-v8a, armeabi-v7a, armeabi], but only found: [].,的确是因为无法找到`` libmmkv.so 导致的

lingol commented 1 month ago

If you can't understand the logic behind downgrading to your original version to narrow down the cause, think about it again.

I should lock this issue for any unnecessary bias.