0

I have the following code in an Android project:

static {
        System.loadLibrary("FLAC");
        System.load("libLibFlacWrapper.so");
    }

This code runs perfectly well on android 21, and a variety of other API levels i've manually tested. I've also tried loadLibrary for libLibFlacWrapper.so but that doesn't work either.

However when I try and run the project on an API 10 device I get:

Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lxappmedia/xvrclientandroid/FLACStreamEncoder;
E/AndroidRuntime(28810):    at xappmedia.xvrclientandroid.XVRRecognizer.<init>(XVRRecognizer.java:118)
E/AndroidRuntime(28810):    at xappmedia.sdk.service.XVRSpeechRecognizerImpl.<init>(XVRSpeechRecognizerImpl.java:24)
E/AndroidRuntime(28810):    at xappmedia.sdk.core.Global.getSpeechRecognizer(Global.java:426)
E/AndroidRuntime(28810):    at xappmedia.sdk.state.AdDirectorContext.initialize(AdDirectorContext.java:133)
E/AndroidRuntime(28810):    at xappmedia.sdk.state.AdDirector.playAdvertisement(AdDirector.java:186)
E/AndroidRuntime(28810):    at xappmedia.sdk.XappAds.playAd(XappAds.java:812)
E/AndroidRuntime(28810):    at xappmedia.sdk.XappAds$19.run(XappAds.java:629)
E/AndroidRuntime(28810):    at xappmedia.sdk.core.Global$1.run(Global.java:260)
E/AndroidRuntime(28810): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load libLibFlacWrapper.so: findLibrary returned null
E/AndroidRuntime(28810):    at xappmedia.xvrclientandroid.FLACStreamEncoder.<clinit>(FLACStreamEncoder.java:33)

The FLAC library loads correctly, but no matter what naming I use for libLibFlacWrapper.so i can't get it to load properly on API 10.

I don't see anything documenting different behaviors between API levels on this topic.

2
  • It seems there are some problems in JNI_Onload call in library libLibFlacWrapper.so. Could you see the code and check to see if there is exception throw in JNI_Onload
    – alijandro
    Jan 14, 2015 at 2:10
  • Nah, i resolved this. It was a naming issue. It appears based on my experience here that Android became more flexible with .so naming over time. Jan 14, 2015 at 15:14

1 Answer 1

1

We have the same problem. It seems that Android 10 only supports “system.loadLibrary()" writing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.