1. 程式人生 > >java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/xxx/lib/arm/liblame.so: has text relocations

java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/xxx/lib/arm/liblame.so: has text relocations

是把 tsd init ava ces cnblogs 項目配置 測試的 arm

最近在寫本地錄音轉碼過程中引入了liblame.so,我這邊用了不同系統版本的手機測試本地錄音都沒有出現問題,但是有一天,同事在測試的時候,出現了以下錯誤:

09-13 17:32:29.140 26874-27362/com.axxn.xx E/linker: /data/app/com.axxn.xx-2/lib/arm/liblame.so: has text relocations
09-13 17:32:29.192 26874-27362/com.axxn.xx E/AndroidRuntime: FATAL EXCEPTION: Thread-13
                                                                Process: com.axxn.xx, PID: 26874
                                                                java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/com.axxn.xx-2/lib/arm/liblame.so: has text relocations
                                                                    at java.lang.Runtime.loadLibrary0(Runtime.java:994)
                                                                    at java.lang.System.loadLibrary(System.java:1533)
                                                                    at net.sourceforge.lame.Lame.<clinit>(Lame.java:35)
                                                                    at net.sourceforge.lame.Lame.initializeEncoder(Native Method)
                                                                    at com.axxn.xx.modules.record.scene.SceneRecorderHandler.run(SceneRecorderHandler.java:76)

經查資料得知,原來是Google在API23以後把這個原本是Warn標誌升級到了Error標誌,故會報錯。

解決辦法就是把我們項目配置中的targetSdkVersion版本改為22或者以下,問題就會得到解決。

在此記錄下這個錯誤。

java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/xxx/lib/arm/liblame.so: has text relocations