应用兼容性问题-abi动态库错误分析和解决

1,应用名和现象

运行环境: 云手机

现象:

2,分析

--------- beginning of crash

08-14 03:59:59.014 28740 28740 E AndroidRuntime: FATAL EXCEPTION: main

08-14 03:59:59.014 28740 28740 E AndroidRuntime: Process: com.ksxkq.autoclick, PID: 28740

08-14 03:59:59.014 28740 28740 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.ksxkq.autoclick-tOipfjY1awBPkGTvjsBKzQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.ksxkq.autoclick-tOipfjY1awBPkGTvjsBKzQ==/lib/arm, /data/app/com.ksxkq.autoclick-tOipfjY1awBPkGTvjsBKzQ==/base.apk!/lib/armeabi, /system/lib]]] couldn't find "libmmkv.so"

08-14 03:59:59.014 28740 28740 E AndroidRuntime: at java.lang.Runtime.loadLibrary0(Runtime.java:1012)

08-14 03:59:59.014 28740 28740 E AndroidRuntime: at java.lang.System.loadLibrary(System.java:1669)

08-14 03:59:59.014 28740 28740 E AndroidRuntime: at com.tencent.mmkv.MMKV.doInitialize(MMKV.java:194)

08-14 03:59:59.014 28740 28740 E AndroidRuntime: at com.tencent.mmkv.MMKV.initialize(MMKV.java:181)

08-14 03:59:59.014 28740 28740 E AndroidRuntime: at com.tencent.mmkv.MMKV.initialize(MMKV.java:84)

08-14 03:59:59.014 28740 28740 E AndroidRuntime: at com.ksxkq.autoclick.MMKVManager.init(Unknown Source:118)

08-14 03:59:59.014 28740 28740 E AndroidRuntime: at com.ksxkq.autoclick.provider.InitializeContentProvider.onCreate(Unknown Source:104)

08-14 03:59:59.014 28740 28740 E AndroidRuntime: at android.content.ContentProvider.attachInfo(ContentProvider.java:1917)

08-14 03:59:59.014 28740 28740 E AndroidRuntime: at android.content.ContentProvider.attachInfo(ContentProvider.java:1892)

08-14 03:59:59.014 28740 28740 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:6438)

08-14 03:59:59.014 28740 28740 E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:5985)

08-14 03:59:59.014 28740 28740 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5900)

08-14 03:59:59.014 28740 28740 E AndroidRuntime: at android.app.ActivityThread.access$1100(ActivityThread.java:200)

08-14 03:59:59.014 28740 28740 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1651)

08-14 03:59:59.014 28740 28740 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)

08-14 03:59:59.014 28740 28740 E AndroidRuntime: at android.os.Looper.loop(Looper.java:193)

08-14 03:59:59.014 28740 28740 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6716)

08-14 03:59:59.014 28740 28740 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)

08-14 03:59:59.014 28740 28740 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)

08-14 03:59:59.014 28740 28740 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

08-14 03:59:59.015 2190 12404 W ActivityManager: Force finishing activity com.ksxkq.autoclick/.ui.InterstitialAdActivity

08-14 03:59:59.018 28740 28740 I Process : Sending signal. PID: 28740 SIG: 9

08-14 03:59:59.068 2190 12404 I ActivityManager: Process com.ksxkq.autoclick (pid 28740) has died: fore TOP

08-14 03:59:59.068 2190 2207 W libprocessgroup: kill(-28740, 9) failed: No such process

08-14 03:59:59.068 2190 2207 I libprocessgroup: Successfully killed process cgroup uid 10063 pid 28740 in 0ms

08-14 03:59:59.068 2128 2128 I Zygote : Process 28740 exited due to signal (9)

通过日志可以看到该问题是因为加载native底层库 libmmkv.so失败导致,通过查看安装路径:

/data/app/com.ksxkq.autoclick-tOipfjY1awBPkGTvjsBKzQ==/lib/arm # ls
libsgcore.so libutils.so

发现确实没有这个库,但是通过查看apk文件发现,这个apk有不同架构:

发现arm64-v8a中有libmmkv.so, 而armeabi中没有

说明默认安装,选择了了armeabi的库。

通过查看abilist,可以看到原因

getprop | grep abi

[ro.product.cpu.abi]: [x86_64]

[ro.product.cpu.abilist]: [x86_64,x86,armeabi,armeabi-v7a,arm64-v8a]

[ro.product.cpu.abilist32]: [x86,armeabi,armeabi-v7a]

[ro.product.cpu.abilist64]: [x86_64,arm64-v8a]

[ro.vendor.product.cpu.abilist]: [x86_64,x86,armeabi,armeabi-v7a,arm64-v8a]

[ro.vendor.product.cpu.abilist32]: [x86,armeabi,armeabi-v7a]

[ro.vendor.product.cpu.abilist64]: [x86_64,arm64-v8a]

可以看到,优先是安装了armeabi的底层库。

3, 解决

方法1, 如果有源码,就修改产品的的配置文件,调整顺序:

Native Bridge ABI List

NB_ABI_LIST_32_BIT := armeabi armeabi-v7a

NB_ABI_LIST_64_BIT := arm64-v8a

方法2: 手动安装

adb install --abi arm64-v8a 贝利自动电击器.apk

最后可以正常启动

相关推荐
TIANGEKUAJING14 天前
2024年云手机推荐榜单:高性能云手机推荐
云手机·海外云手机·tiktok云手机·tiktok运营·云手机推荐·云手机排行
TIANGEKUAJING15 天前
海外云手机在出海业务中的优势有哪些?
企业出海·云手机·海外云手机·云手机推荐·云手机群控·企业海外网络
TIANGEKUAJING23 天前
海外云手机是什么?对外贸电商有什么帮助?
云手机·海外云手机·tiktok云手机·tiktok运营
Grassto25 天前
云手机简述(概况,使用场景,自己部署云手机)
云手机
TIANGEKUAJING25 天前
海外云手机怎样助力亚马逊店铺运营?
亚马逊运营·云手机·海外云手机·亚马逊店铺运营
TIANGEKUAJING1 个月前
海外云手机实现高效的海外社交媒体营销
海外社媒营销·云手机·海外云手机·云手机推荐·海外社媒运营
TIANGEKUAJING1 个月前
云手机:社交平台运营的热门工具
云手机·海外云手机·云手机海外版·社媒运营·海外社媒运营·云手机群控·手机群控
TIANGEKUAJING1 个月前
出海电商新怎样用海外云手机引流?
云手机·海外云手机·云手机海外版·电商云手机
TIANGEKUAJING1 个月前
解决海外社媒风控问题的工具——云手机
海外社媒营销·云手机·海外云手机·云手机海外版·海外社媒运营
TIANGEKUAJING1 个月前
云手机哪款好用?2024年云手机推荐对比指南
云手机·海外云手机·海外社媒运营·云手机群控·手机群控