Dmiters
Dmiters

Reputation: 2031

Loading a native library for Android using Eclipse

I'm fairly new to Android development and I've been trying for a while now but I just don't get it. I'm writing an app for android that creates gifs, and for that I'm using this library. I compiled it into an .so but now I just don't understand how to actually load it. I put the .so in /libs/armeabi/ but when I load it like

    static {
        System.loadLibrary("gifflen");
    }    

it throws

   ERROR/AndroidRuntime(13565): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load gifflen: findLibrary returned null

Am I supposed to put it somewhere else? Or is this because of some setting in Eclipse I was supposed to change? I've mucked about with the native library option in Java Build Path but that doesn't seem to be what I'm looking for. I've also googled around a bit and found an answer that said to select select Android Tools->Add Native Support but I don't have that option.

Upvotes: 9

Views: 23183

Answers (2)

Giancarlo
Giancarlo

Reputation: 139

Substantially, you need to tell the system that such library exists and where it is located. This is done inside Eclipse by right-clicking on the project name and then selecting "Android Tools" and then "Add Native Support". If the project already has Native Support, this option is not present - if you are a beginner it is better that you create a new project from scratch.

Upvotes: 13

CaseyB
CaseyB

Reputation: 25058

You built into into an .so how? Using the NDK? If so then the file that was created should have been called libgrifflen.so. Was it?

Upvotes: 15

Related Questions