Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

引用Library Module成功,但是在XML引用org.wysaid.view.CameraRecordGLSurfaceView,报错 #15

Closed
RockyLin opened this issue Jul 24, 2016 · 11 comments

Comments

@RockyLin
Copy link

IDE:Android Studio
引用第android-gpuimage-plus Library做为Dependency Lib, 没有问题。但是在布局里面,使用了Library中的org.wysaid.view.CameraRecordGLSurfaceView, 运行报错如下:

E/AndroidRuntime: FATAL EXCEPTION: GLThread 1340
Process: com.rocky.TestApp, PID: 26679
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.rocky.TestApp-1/base.apk"],nativeLibraryDirectories=[/data/app/com.rocky.TestApp-1/lib/arm64, /data/app/com.rocky.TestApp-1/base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]] couldn't find "libx264.142.so"
at java.lang.Runtime.loadLibrary(Runtime.java:367)
at java.lang.System.loadLibrary(System.java:1076)
at org.wysaid.nativePort.NativeLibraryLoader.load(NativeLibraryLoader.java:15)
at org.wysaid.nativePort.CGEFrameRenderer.(CGEFrameRenderer.java:11)
at org.wysaid.view.CameraGLSurfaceView.onSurfaceCreated(CameraGLSurfaceView.java:413)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1503)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

报错行NativeLibraryLoader.java:15:
System.loadLibrary("x264.142");

后来我在这个库的Demo上试着改了应用的包名,也出现运行报错。把包名改回来,就能正常运行。

大神能给个解释吗?

@geek-paulwong
Copy link

求大神解答。我遇到同样的问题。;)

@wysaid
Copy link
Owner

wysaid commented Jul 24, 2016

@RockyLin @geek-paulwong libx264.142 这个文件是arm-v7a 架构的, 我看到你们的报错里面有 arm64-v8a 字样, 应该是加载的路径错误, 这个需要你们改正一下~~
这个编译用到armv7的neon指令, 只有 arm-v7a 版本。 对于64位的可以通用哦, 你们这只是没有加载到lib而已

@RockyLin
Copy link
Author

@wysaid 考虑到arm64-v8a里面没有libx264.142这个文件(解压apk后查看,确实没有),我把armeabi-v7a这个文件夹以及里面的so复制了好几份,并分别改名为:arm64-v8a, x86, x86_64, armeabi, 放在armeabi-v7a所在的lib下,运行报错如下:

java.lang.UnsatisfiedLinkError: dlopen failed: file offset for the library "/data/app/com.rocky.TestApp-1/lib/arm64/libx264.142.so" >= file size: 0 >= 0
at java.lang.Runtime.loadLibrary(Runtime.java:372)
at java.lang.System.loadLibrary(System.java:1076)
at org.wysaid.nativePort.NativeLibraryLoader.load(NativeLibraryLoader.java:15)
at org.wysaid.nativePort.CGEFrameRenderer.(CGEFrameRenderer.java:11)
at org.wysaid.view.CameraGLSurfaceView.onSurfaceCreated(CameraGLSurfaceView.java:413)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1503)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

谢谢大神!

@geek-paulwong
Copy link

请问大神,通用的话,应该怎么设置。谢谢。

@wysaid
Copy link
Owner

wysaid commented Jul 25, 2016

@RockyLin
首先, 你的方法是错误的, armv7的链接库乱甩目录本身就是盲目的。
你可以去下载一个 snow 的apk包, 然后解压看看它的 opencv, ffmpeg是不是只有 armv7a 这个目录下有。 而它也有其他架构的so, 混用的。
@geek-paulwong
这种问题请自行解决一下。
最简单的办法, 你们把所有非 armv7a 架构的目录全部删掉, 只保留 armv7a, 就像faceu那样

@silentsugar
Copy link

长时间录制视频,会挂掉,不知道是否可以开源jni的代码,想研究下?

@wysaid
Copy link
Owner

wysaid commented Jul 31, 2016

@silentsugar
有这个问题哇, 我这边看到还好呀, 请问你用的是什么设备呢, 以及录制了多久

@silentsugar
Copy link

一般12个小时以上,android国产平板定制出来的

@wysaid
Copy link
Owner

wysaid commented Aug 1, 2016

@silentsugar
确实有点长, 这种情况的话, 你肯定得分段啊, 正常情况也会分段的, 不会说一个文件十二个小时的, 你应该定时保存录制结果, 比如每半小时保存一次或者每十分钟保存一次

@geek-paulwong
Copy link

@wysaid Thank you!!! 👍

@wysaid wysaid closed this as completed Sep 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants