myrao / ScreenRecorder

A demo of Android screen recorder, no root but SDK version should more than Android 5.0 API 21.
497 stars 174 forks source link

找不到so库screenrecorderrtmp #37

Closed addriumruss closed 3 years ago

addriumruss commented 3 years ago

public class MyApplication extends Application {

static {
    System.loadLibrary("screenrecorderrtmp");  //这句崩溃
}

。。。。。。

E/AndroidRuntime: FATAL EXCEPTION: main Process: net.yrom.screenrecorder, PID: 25404 java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/net.yrom.screenrecorder-4jz3F0VzLIiOI6jt-W4BQw==/base.apk"],nativeLibraryDirectories=[/data/app/net.yrom.screenrecorder-4jz3F0VzLIiOI6jt-W4BQw==/lib/arm64, /system/lib64, /hw_product/lib64, /system/product/lib64]]] couldn't find "libscreenrecorderrtmp.so" at java.lang.Runtime.loadLibrary0(Runtime.java:1067) at java.lang.Runtime.loadLibrary0(Runtime.java:1007) at java.lang.System.loadLibrary(System.java:1668) at net.yrom.screenrecorder.application.MyApplication.(MyApplication.java:15) at java.lang.Class.newInstance(Native Method)

搜索文件夹发现文件libscreenrecorderrtmp.so存在,但是android-studio启动调试就报找不到文件 请问这个怎么折腾?

myrao commented 3 years ago

armeabi 设置为 v7a 试试,看你的报错是需要 arm64 架构的 so 包,需要重新编译 arm64 的 so

addriumruss commented 3 years ago

@myrao 感谢回应! 不过请问怎么重新编译啊 交叉编译不太会...

myrao commented 3 years ago

Android.mk 中新增 platform arm64,然后 ndk-build 或者改成 CmakeList.txt 来实现也可以的~

addriumruss commented 3 years ago

感谢支持! 最后配置文件这样修改终于可以运行了: ndk { abiFilters "armeabi-v7a", "arm64-v8a", "x86", "mips" }