Skip to content Skip to sidebar Skip to footer

How To Include Prebuilt Shared Libraries In Apk With Eclipse

I have a shared library libfoo.so and need to use it in my android app. My first try was to have in Android.mk: include $(CLEAR_VARS) LOCAL_MODULE := test LOCAL_SRC_FILES := test.c

Solution 1:

The include appears to be misspelt:

include$(PREBUILD_SHARED_LIBRARY)

should be

include$(PREBUILT_SHARED_LIBRARY)

Solution 2:

Found the solution!! LOCAL_SRC_FILES can not have absolute or relative paths, just the filename. The path must be set in LOCAL_PATH.

So in my case, instead of:

LOCAL_SRC_FILES := $(FOO_PATH)/libfoo.so

I have now:

LOCAL_PATH := $(FOO_PATH)
LOCAL_SRC_FILES := libfoo.so

And this works ok.

Solution 3:

In eclipse, i add a static library by copying the file in the path project/libs/armeabi/ and rebuild the project after cleaning it. This includes the .so in the apk.

Post a Comment for "How To Include Prebuilt Shared Libraries In Apk With Eclipse"