集成音频.so报错,找不到对应的so库文件

10:23:52.952 25917-25917/mobi.accessible.fm E/CrashReport: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file “/data/app/mobi.accessible.fm-2/base.apk”],nativeLibraryDirectories=[/data/app/mobi.accessible.fm-2/lib/arm, /data/app/mobi.accessible.fm-2/base.apk!/lib/armeabi, /vendor/lib, /system/lib]]] couldn’t find “libagora-rtc-sdk-jni.so”
at java.lang.Runtime.loadLibrary(Runtime.java:367)
at java.lang.System.loadLibrary(System.java:1076)
at io.agora.rtc.internal.RtcEngineImpl.loadNativeLibrary(RtcEngineImpl.java:146)
at io.agora.rtc.internal.RtcEngineImpl.initializeNativeLibs(RtcEngineImpl.java:152)
at io.agora.rtc.RtcEngine.create(RtcEngine.java:62)
at mobi.accessible.fm.module.chatroom.manager.RtcManager.init(RtcManager.java:57)
官方demo中可以运行,但集成到项目中就报错了,部分手机可以但部分手机找不到对应的so库,和已经集成的第三方库文件夹有些不对应,所以想请教一下这种情况该如何操作?

”部分手机可以但部分手机不行“,尝试用android studio手动添加外部so库

这个手动添加外部so库是什么意思?没有太明白?

提供一下log文件看看

完整点的log file

这个log文件没有权限上传,只能多复制一些代码片段了
04-10 16:06:15.208 10603-10603/mobi.accessible.fm:player E/MtaSDK.CaughtExp: MTA has caught the following uncaught exception:
04-10 16:06:15.208 10603-10603/mobi.accessible.fm:player E/MtaSDK.CaughtExp: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file “/data/app/mobi.accessible.fm-1/base.apk”],nativeLibraryDirectories=[/data/app/mobi.accessible.fm-1/lib/arm, /data/app/mobi.accessible.fm-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]] couldn’t find “libxmediaplayer.so”
at java.lang.Runtime.loadLibrary(Runtime.java:367)
at java.lang.System.loadLibrary(System.java:1076)
at com.ximalaya.ting.android.player.XMediaplayerJNI.(XMediaplayerJNI.java:493)
at com.ximalaya.ting.android.player.XMediaPlayerWrapper.init(XMediaPlayerWrapper.java:53)
at com.ximalaya.ting.android.player.XMediaPlayerWrapper.(XMediaPlayerWrapper.java:73)
at com.ximalaya.ting.android.opensdk.player.service.XmMediaPlayerFactory.getMediaPlayer(XmMediaPlayerFactory.java:44)
at com.ximalaya.ting.android.opensdk.player.service.XmPlayerControl.setupPlayer(XmPlayerControl.java:528)
at com.ximalaya.ting.android.opensdk.player.service.XmPlayerControl.initPlayerDataSource(XmPlayerControl.java:217)
at com.ximalaya.ting.android.opensdk.player.service.XmPlayerControl.init(XmPlayerControl.java:196)
at com.ximalaya.ting.android.opensdk.player.service.XmPlayerControl.initAndPlay(XmPlayerControl.java:265)
at com.ximalaya.ting.android.opensdk.player.service.XmPlayerService.playTrackInner(XmPlayerService.java:1596)
at com.ximalaya.ting.android.opensdk.player.service.XmPlayerService.access$2900(XmPlayerService.java:144)
at com.ximalaya.ting.android.opensdk.player.service.XmPlayerService$6.onSuccess(XmPlayerService.java:1474)
at com.ximalaya.ting.android.opensdk.player.service.XmPlayerService$6.onSuccess(XmPlayerService.java:1463)
at com.ximalaya.ting.android.opensdk.httputil.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:93)
at android.os.Handler.handleCallback(Handler.java:742)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5684)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:746)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
04-10 16:06:15.209 10603-10603/mobi.accessible.fm:player E/MtaSDK.CaughtExp: App uncaught exception end.
04-10 16:06:15.209 10603-10603/mobi.accessible.fm:player E/AndroidRuntime: FATAL EXCEPTION: main
Process: mobi.accessible.fm:player, PID: 10603
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file “/data/app/mobi.accessible.fm-1/base.apk”],nativeLibraryDirectories=[/data/app/mobi.accessible.fm-1/lib/arm, /data/app/mobi.accessible.fm-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]] couldn’t find “libxmediaplayer.so”
at java.lang.Runtime.loadLibrary(Runtime.java:367)
at java.lang.System.loadLibrary(System.java:1076)
at com.ximalaya.ting.android.player.XMediaplayerJNI.(XMediaplayerJNI.java:493)
at com.ximalaya.ting.android.player.XMediaPlayerWrapper.init(XMediaPlayerWrapper.java:53)
at com.ximalaya.ting.android.player.XMediaPlayerWrapper.(XMediaPlayerWrapper.java:73)
at com.ximalaya.ting.android.opensdk.player.service.XmMediaPlayerFactory.getMediaPlayer(XmMediaPlayerFactory.java:44)
at com.ximalaya.ting.android.opensdk.player.service.XmPlayerControl.setupPlayer(XmPlayerControl.java:528)
at com.ximalaya.ting.android.opensdk.player.service.XmPlayerControl.initPlayerDataSource(XmPlayerControl.java:217)
at com.ximalaya.ting.android.opensdk.player.service.XmPlayerControl.init(XmPlayerControl.java:196)
at com.ximalaya.ting.android.opensdk.player.service.XmPlayerControl.initAndPlay(XmPlayerControl.java:265)
at com.ximalaya.ting.android.opensdk.player.service.XmPlayerService.playTrackInner(XmPlayerService.java:1596)
at com.ximalaya.ting.android.opensdk.player.service.XmPlayerService.access$2900(XmPlayerService.java:144)
at com.ximalaya.ting.android.opensdk.player.service.XmPlayerService$6.onSuccess(XmPlayerService.java:1474)
at com.ximalaya.ting.android.opensdk.player.service.XmPlayerService$6.onSuccess(XmPlayerService.java:1463)
at com.ximalaya.ting.android.opensdk.httputil.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:93)
at android.os.Handler.handleCallback(Handler.java:742)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5684)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:746)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
04-10 16:06:15.297 280-280/? E/lowmemorykiller: Error writing /proc/10603/oom_score_adj; errno=22
04-10 16:06:15.298 280-280/? E/lowmemorykiller: Error writing /proc/10603/oom_score_adj; errno=22
04-10 16:06:15.325 393-507/? E/ThermalEngine: Failed to set desired CPU[1] frequency limit to 1497600
04-10 16:06:15.325 393-507/? E/ThermalEngine: Failed to set desired CPU[2] frequency limit to 1497600
04-10 16:06:15.711 11219-11219/mobi.accessible.fm:player E/CrashReport: CrashReport has not been initialed! pls to call method ‘initCrashReport’ first!
04-10 16:06:15.714 11219-11219/mobi.accessible.fm:player E/CrashReport: --------------------------------------------------------------------------------------------
04-10 16:06:15.714 11219-11219/mobi.accessible.fm:player E/CrashReport: --------------------------------------------------------------------------------------------
04-10 16:06:15.780 11219-11251/mobi.accessible.fm:player E/MtaSDK: Could not get permission of android.permission.READ_PHONE_STATE
04-10 16:06:15.990 11219-11219/mobi.accessible.fm:player E/NAccs.MiPushRegistar: register not in main process, return
04-10 16:06:15.990 11219-11219/mobi.accessible.fm:player E/NAccs.HuaWeiRegister: register not in main process, return
04-10 16:06:16.078 11291-11304/? E/NativeLibraryHelper: Failed to load assets verifier: 0
04-10 16:06:16.173 11219-11219/mobi.accessible.fm:player E/kepler: Ridsdk_safe:2131689472
04-10 16:06:16.203 11219-11219/mobi.accessible.fm:player E/kepler: Kepler asyncInitSdk onSuccess
04-10 16:06:17.115 1871-1956/? E/NativeLibraryHelper: Failed to load assets verifier: 0
04-10 16:06:17.444 393-507/? E/ThermalEngine: Failed to set desired CPU[1] frequency limit to 1728000
04-10 16:06:17.445 393-507/? E/ThermalEngine: Failed to set desired CPU[2] frequency limit to 1728000
04-10 16:06:18.789 393-507/? E/ThermalEngine: Failed to set desired CPU[1] frequency limit to 1497600
04-10 16:06:18.789 393-507/? E/ThermalEngine: Failed to set desired CPU[2] frequency limit to 1497600
04-10 16:06:19.303 393-507/? E/ThermalEngine: Failed to set desired CPU[1] frequency limit to 1728000
04-10 16:06:19.304 393-507/? E/ThermalEngine: Failed to set desired CPU[2] frequency limit to 1728000
04-10 16:06:20.799 1871-1956/? E/NativeLibraryHelper: Failed to load assets verifier: 0
04-10 16:06:23.535 393-507/? E/ThermalEngine: Failed to set desired CPU[1] frequency limit to 1497600
04-10 16:06:23.535 393-507/? E/ThermalEngine: Failed to set desired CPU[2] frequency limit to 1497600
04-10 16:06:24.242 393-507/? E/ThermalEngine: Failed to set desired CPU[1] frequency limit to 1190400
04-10 16:06:24.243 393-507/? E/ThermalEngine: Failed to set desired CPU[2] frequency limit to 1190400
04-10 16:06:35.914 1103-1213/? E/AudioFlinger: open /proc/8018/cmdline error
04-10 16:06:35.928 1103-1205/? E/ACDB-LOADER: Error: ACDB AudProc vol returned = -19

gradle.properties中设置 android.bundle.enableUncompressedNativeLibs=false 看下

那 app build里面是需要这么设置么?


其中前两个是以前项目中有的 后面两个是集成直播间新增的 image

先只改这出问题的看看,不行再把前面两个也一起改一下

这个也不行啊 还是会报错,如果那四个库框架都写上可以运行起来,但以前的功能受到影响用不了,如果不写,直播间初始化崩溃


设置之后还是会在运行的时候初始化SDK 崩溃,还是说我集成的有问题?你能不能截个图 包括module build 我对比一下看看哪里出差错了

命令行窗口,切换到apktool文件夹目录下。接下来把apk拷贝到E:\Android\apktools下面,然后在cmd窗口输入命令,回车,如下图:
apktool d yourapp.apk
检查 lib 是否在 arm64-v8a 和 armeabi-v7a 是否都有上述的 so

你的意思是反编译apk,看看生成的apk中是否有对应的so文件是吧?不过我觉得没有这个必要,首先,如果按你说的发现有so库文件,那么app肯定就可以正常运行了吧?我在仔细描述一下我的问题吧:
1:未集成之前正常
2:集成进来之后,在app 下的Application内调用 RtcManager.instance(this).init(); RtmManager.instance(this).init();
3:在APP build下有’armeabi’, ‘arm64-v8a’ 改成’armeabi’, ‘arm64-v8a’,‘x86’,'armeabi-v7a’可以正常使用直播间但对app以前功能有影响,如果不添加so库框架,app运行第2步初始化会崩溃
4:所以说,现在主要想问的是如何在兼顾以前功能的前提下解决当前问题?

另外,你上面说的那个apktool 我按照你说的使用 结果没有libs 文件啊


image
只有两个文件夹

所以你的问题是,不添加 armeabi-v7a 库会导致在部分设备上无法运行是么?那应该是因为你的这部分手机是 armeabi-v7a 架构的,如果你没有集成对应的 so 库,会出现无法兼容的问题。必须要集成对应架构的 so 库文件的。

你说的 “对app以前功能有影响” 具体是指什么问题?会和你们集成的第三方 SDK 或功能有冲突吗?