RtcEngine初始化失败 提示couldn't find "libagora-rtc-sdk-jni.so"


#1

问题详情:

07-21 15:52:04.865 15440-15519/com.dodoo_tech.voip E/AndroidRuntime: FATAL EXCEPTION: Thread-5651
                                                                     Process: com.dodoo_tech.voip, PID: 15440
                                                                     java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.dodoo_tech.voip-1/base.apk", zip file "/data/app/com.dodoo_tech.voip-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.dodoo_tech.voip-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.dodoo_tech.voip-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.dodoo_tech.voip-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.dodoo_tech.voip-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.dodoo_tech.voip-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.dodoo_tech.voip-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.dodoo_tech.voip-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.dodoo_tech.voip-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.dodoo_tech.voip-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.dodoo_tech.voip-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.dodoo_tech.voip-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libagora-rtc-sdk-jni.so"
                                                                         at java.lang.Runtime.loadLibrary(Runtime.java:366)
                                                                         at java.lang.System.loadLibrary(System.java:988)
                                                                         at io.agora.rtc.internal.RtcEngineImpl.initializeNativeLibs(RtcEngineImpl.java:210)
                                                                         at io.agora.rtc.RtcEngine.create(RtcEngine.java:20)
                                                                         at com.dodoo_tech.sdk.agora.test.WorkerThread.ensureRtcEngineReadyLock(WorkerThread.java:226)
                                                                         at com.dodoo_tech.sdk.agora.test.WorkerThread.run(WorkerThread.java:106)
 
环境配置:请查看附件

#2

gradle配置:


#3

问题我自己解决了。libs环境没配好的问题

方案:
从官网下载例子,我用的是“OpenVideoCall_Android”。
1.首先集成项目时照抄例子上gradle的配置;
2.然后将下载来的libs文件夹整个复制到集成项目的主项目(app)的根目录下;
3.最后修改libs的配置目录,这里有两个地方要修改:
   第一个地方是主项目的gradle,修改所有“../../../libs”为“libs”(也就是去掉../../../)
   第二个地方是video_preprocessing_plugin_jni.cpp:
#include "../../../../../../libs/include/IAgoraRtcEngine.h" 
#include "../../../../../../libs/include/IAgoraMediaEngine.h"
以上两行代码改为(去掉../../../):
#include "../../../libs/include/IAgoraRtcEngine.h" 
#include "../../../libs/include/IAgoraMediaEngine.h"
 
clean一下项目运行即可。
 

#4

非常感谢您的关注与支持,为其他开发者提供了经验~


#5

非常感谢您的关注与支持,为其他开发者提供了经验~


#6

"第二个地方是video_preprocessing_plugin_jni.cpp:"这个在哪里改啊 我的项目里好像没有这个