HeyNine
HeyNine

Reputation: 21

How to build two ".so" files in Android

My question is:
I have used ndk to develop some functions, when built, it created a .so file in libs/armeabi.
Now I needed to add another .so file from others.
I only copied the .so to my dir libs/armeabi, then built it.
The .so file was missing and I only had mine.

I do not kown why it happens. Should I need to config my Android.mk file, or any else?

Upvotes: 2

Views: 269

Answers (1)

thiagolr
thiagolr

Reputation: 7027

This happens because the libs folder is cleaned when you run the ndk-build!

Edit your Android.mk and add this:

include $(CLEAR_VARS)
LOCAL_MODULE := MYOTHERSO-prebuilt 
LOCAL_SRC_FILES := [relative path to your other .so]/lib[change to your lib name].so 
LOCAL_EXPORT_C_INCLUDES := [relative path to your other .so include files]
include $(PREBUILT_SHARED_LIBRARY)

You should store the .so file on another path (not on libs/armeabi folder) in order to reference it from your Android.mk. During ndk-build it will be copied to libs/armeabi folder.

Upvotes: 2

Related Questions