Android Question Library has text relocations on API26

KZero

Active Member
Licensed User
Longtime User
Hello,

i'm upgrading an app to API 26 , after changing target api to 26 instead of 21 i got this error

B4X:
** Activity (main) Create, isFirst = true **
java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.test-AQLJKddiLKGSeN75_Lf5Rg==/lib/arm/libspeex.so" has text relocations
    at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
    at java.lang.System.loadLibrary(System.java:1657)
    at com.purplefrog.speexjni.SpeexEncoder.<clinit>(SpeexEncoder.java:72)
    at uk.co.martinpearman.b4a.ndkspeex.SpeexEncoderWrapper.Initialize(SpeexEncoderWrapper.java:121)
    at com.test.main._activity_create(main.java:444)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:342)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
    at com.test.main.afterFirstLayout(main.java:102)
    at com.test.main.access$000(main.java:17)
    at com.test.main$WaitForLayout.run(main.java:80)
    at android.os.Handler.handleCallback(Handler.java:789)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6938)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
** Activity (main) Resume **

library : NDKSpeex wrapped by @warwound (i don't have the library source code)

any ideas to make it work ?
 

moster67

Expert
Licensed User
Longtime User
This is a common problem with older binaries (native libs = so-files such as "libspeex.so" in your case). Google added some checks some time ago and now requires that said binaries are recompiled to adhere to their requirements. This happened to many libs using non-adhering binaries.

The solutions are either targeting a lower SDK-version (which is probably not going to resolve your problems since Google will soon require that apps are set to targetSdkVersion to 26+) or the binary/library (not the wrapper) is being recompiled to adhere to the new requisites. I don't think @warwound could do anything about it even he wanted to unless the code for compiling the binary is ready-available. If you are lucky, the author of the library, that was wrapped by @warwound, may have recompiled the sources and then the library could be re-wrapped including the updated binaries.

Edit: a long shot: If the author did recompile the binaries, then get hold of them and if you are lucky you could unzip the wrapper and replace the binaries and then zip-compress it again although most of the times this approach will fail....
 
Upvote 0

KZero

Active Member
Licensed User
Longtime User
This is a common problem with older binaries (native libs = so-files such as "libspeex.so" in your case). Google added some checks some time ago and now requires that said binaries are recompiled to adhere to their requirements. This happened to many libs using non-adhering binaries.

The solutions are either targeting a lower SDK-version (which is probably not going to resolve your problems since Google will soon require that apps are set to targetSdkVersion to 26+) or the binary/library (not the wrapper) is being recompiled to adhere to the new requisites. I don't think @warwound could do anything about it even he wanted to unless the code for compiling the binary is ready-available. If you are lucky, the author of the library, that was wrapped by @warwound, may have recompiled the sources and then the library could be re-wrapped including the updated binaries.

Edit: a long shot: If the author did recompile the binaries, then get hold of them and if you are lucky you could unzip the wrapper and replace the binaries and then zip-compress it again although most of the times this approach will fail....

Thanks Oster, it really helped me to get it work
Please accept my little donation
 
Upvote 0
Top