Build a system app with a .so pre-library

I've been stuck here for a week trying to build a third party .so library along with my app to a custom android system. I have followed http://www.maxters.net/2012/05/adding-prebuilt-shared-library-to-android-build-system/ and have successfully added the .so lib as a prebuilt shared library in Android Build System. Now I can see .so lib at ../ out / target / product / crespo4g / obj / lib /.

But the libraries in this directory will not be transferred to the device when flashing. And my .so lib didn't show up in / data / data / my _app_name / lib. Therefore, an UnsatisfiedLinkError is raised when System.loadLibrary () is executed .

I thought there were three ways to solve this problem, but just don't know how to implement:

  • Perhaps my application was unable to tell the compiler that my .so along with my application as a whole, so the .so lib is not compiled into a system image with my application. But I declared "LOCAL_STATIC_LIBRARIES: = libXX", is something wrong?
  • Is there a way to create my .so lib in / system / lib /? Where are such libs under / system / lib / obtained from?

I am new to android building please help ..

Thank!

+4


source to share


1 answer


You might want to check the makefile against the advice in this answer and this one as well as the advice on group thread

UPDATE My original makefile was wrong, but this works for me when building ICS:



LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libmozglue
LOCAL_SRC_FILES := libmozglue.so
LOCAL_MODULE_SUFFIX := .so
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_TAGS := optional
include $(BUILD_PREBUILT)

include $(CLEAR_VARS)
LOCAL_MODULE := libplugin-container
LOCAL_SRC_FILES := libplugin-container.so
LOCAL_MODULE_SUFFIX := .so
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_TAGS := optional
include $(BUILD_PREBUILT)

      

where above are the native libraries required by firefox for android which I include as a system app in my own system build.

+1


source







All Articles