How to pack your own library in an Android application?

I am unsuccessfully trying to enable a built-in library that uses native code in an Android application. I cannot understand what I am doing wrong.

The contents of the finished .apk file are as follows. (I use NetBeans and Ant to build everything - I can include the appropriate parts of the Ant script if someone needs it.)

META-INF
assets
libs >
    armeabi >
        libandroidgl20.so
        libgdx.so
res 
AndroidManifest.xml
classes.dex
resources.arsc

In the application code, I have:

static {
    System.loadLibrary("gdx");
    System.loadLibrary("androidgl20");
}

But I keep getting an error: java.lang.UnsatisfiedLinkError: Library gdx not found.

Am I putting .so files in the right place? Do I need to do something to make sure the runtime is aware of them?

+3
source share
2 answers

System.load () requires an exact path (including full name) to the shared object. This is what you are doing wrong.

System.loadLibrary("gdx"); .

+2

, "gdx" ?
?

0

All Articles