ffmpeg安卓x86平台编译错误(libavcodec.so: has text relocations)
来源:互联网 发布:mac os x系统使用教程 编辑:程序博客网 时间:2024/05/21 17:23
最近本人研究ffmpeg编译,在使用ndk交叉编译x86平台的.so库文件后,加载使用时,出现错误 java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/xxx.xxx.xxx-1/lib/x86/libavcodec.so: has text relocations
原因是android 6.0之后,系统做了限制。
“On previous versions of Android, if your app requested the system to load a shared library with text relocations, the system displayed a warning but still allowed the library to be loaded. Beginning in this release, the system rejects this library if your app’s target SDK version is 23 or higher. To help you detect if a library failed to load, your app should log the dlopen(3) failure, and include the problem description text that the dlerror(3) call returns. To learn more about handling text relocations, see this guide”
针对这个说法,网上很多朋友用降低targetSDK版本的方式来解决,但如果不降低如何解决呢?
从ffmpeg官网有问题单描述,如下:
官方描述中,x86平台会出现此问题,而armv7-a 、x86_64都没有这样的问题,所以只需要针对x86平台解决即可。
OK,可以通过编译时添加 –disable-asm参数解决,设置参数关闭汇编后,编译后.so文件就不存在text relocations了。
可以通过以下方式检查,so文件中是否存在text relocations。
如果存在text relocations,会出现类似以下
0x00000016 (TEXTREL) 0x0
如果grep不到TEXTREL,如下图:
参考:
https://trac.ffmpeg.org/ticket/4928
https://stackoverflow.com/questions/32845956/android-m-crash-java-lang-unsatisfiedlinkerror-dlopen-failed
https://stackoverflow.com/questions/32346402/libavcodec-so-has-text-relocations
- ffmpeg安卓x86平台编译错误(libavcodec.so: has text relocations)
- libdvm.so has text relocations 错误
- Android 8.0 x86 ffmpeg 提示 dlopen failed: "xxxxxx==/lib/x86/xxx.so" has text relocations
- 解决动态库在Android平台加载时libavxcore.so: has text relocations错误
- 错误:has text relocations
- lib***.so: has text relocations
- xx.so: has text relocations
- android so一种异常: has text relocations
- So文件 has text relocations问题
- 调用so库时“xxx.so has text relocations”
- 调用.so 文件时报错has text relocations
- 调用.so 文件时报错has text relocations
- Android 6.0 crash - liblicensing.so: has text relocations
- 调用.so 文件时报错has text relocations(转载)
- 加载xxx.so 库时报 has text relocations
- android studio 调用.so 文件时报错has text relocations
- 优酷SDK导致so加载失败 has text relocations
- 调用.so 文件时报错has text relocations
- Node.js 异步I/O
- 使用 Bitmap Style Designer 为FMX修改已有样式
- 关于网络数据安全的处理
- 正则式总结
- 数据处理后的缓存清除问题:Max retries exceeded with url
- ffmpeg安卓x86平台编译错误(libavcodec.so: has text relocations)
- XMLHttpRequest: 网络错误 0x80700013的解决方案
- Java入门笔记
- Java的算数运算符、关系运算符、逻辑运算符、位运算符
- C++内存泄漏问题
- Android7.0中文文档(API)-- AdapterView.OnItemLongClickListener
- OpenStack的基本概念与架构图
- 条款21:必须返回对象时,别妄想返回其reference
- Nginx:修改配置文件中的user解决访问资源文件时返回403 premission denied