应用兼容性问题-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

最后可以正常启动

相关推荐
云手机周伯通2 天前
Web3.0隐私计算与云手机的结合
web3.0·隐私计算·云手机·云手机推荐·亚矩阵云手机·亚矩阵·web3.0隐私计算
云手机周伯通2 天前
Tiktok矩阵运营中使用云手机的好处
tiktok·tiktok矩阵·云手机·tiktok运营·云手机推荐·亚矩阵云手机·亚矩阵
云手机周伯通2 天前
云手机如何防止设备指纹被篡改
云手机·云手机推荐·亚矩阵云手机·亚矩阵·好用的云手机·云手机设备指纹·云手机imei
七天可修改名字一次1 个月前
云手机如何进行经纬度修改
xposed·云手机·亚矩阵云手机·经纬度修改·虚拟定位·云手机虚拟定位
TIANGEKUAJING3 个月前
怎样用云手机进行海外社媒矩阵引流?
云手机·海外云手机·海外社媒运营·矩阵引流·海外社媒矩阵运营
TIANGEKUAJING3 个月前
云手机群控能用来做什么?
多账号管理·云手机·云手机群控·手机群控·矩阵运营
TIANGEKUAJING5 个月前
2024年云手机推荐榜单:高性能云手机推荐
云手机·海外云手机·tiktok云手机·tiktok运营·云手机推荐·云手机排行
TIANGEKUAJING5 个月前
海外云手机在出海业务中的优势有哪些?
企业出海·云手机·海外云手机·云手机推荐·云手机群控·企业海外网络
TIANGEKUAJING5 个月前
海外云手机是什么?对外贸电商有什么帮助?
云手机·海外云手机·tiktok云手机·tiktok运营
Grassto5 个月前
云手机简述(概况,使用场景,自己部署云手机)
云手机