.so files not getting copied while apk installation

2,294 views
Skip to first unread message

azhar

unread,
Feb 9, 2011, 6:46:34 AM2/9/11
to android-platform
Hi,

If I install manually a third party apk with libraries it is getting
installed and working fine, if i put the same apk in userdata.img (/
data/app), on boot android will install it without any errors but the
application is not working. when i check /data/data/com.XYZ/lib the
folder is empty. It means .so files are not getting copied because of
that the application is not working. Any android folks came across the
same problem please comment.

raghu

unread,
Feb 11, 2011, 5:54:34 AM2/11/11
to android-platform
Hi,

Rename you .apk to .zip file.
Extract the .apk file. you will find the .so file under lib directory

Create a directory called "lib" under your you app.
Copy all .so file into your app/lib directory.

Then create a android make file under your you app.
Use the variable LOCAL_PREBUILT_LIBS to make an entry of all your .so
file.

Use the sample make file:
---------------------------------------------------
LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)

LOCAL_PREBUILT_LIBS := \
lib\libone.so \
lib\libtwo.so \
lib\libThree.so

include $(BUILD_MULTI_PREBUILT)
----------------------------------------------------------
This will places all your .so file in /system/lib/
For more info refer the link: http://source.android.com/porting/build_cookbook.html

~br,
raghu

raghu

unread,
Feb 11, 2011, 6:01:59 AM2/11/11
to android-platform
I said the to keep the make file under app

Place that make file under app/lib directory.

Then LOCAL_PREBUILT_LIBS := \
libone.so \
libtwo.so \
libThree.so

Inside you app directory make file add an entry
"include $(call all-makefiles-under,$(LOCAL_PATH))"
which will call all sub directory make file which is under your app

azhar

unread,
Feb 12, 2011, 4:47:47 AM2/12/11
to android-platform
Thanks Raghu for ur reply.
I extracted the APK, and manually copied the .so files to /system/lib,
when i run the application it is trying to access the library from
apps private storage i.e /data/data/com.XYZ/lib. It is not referring
to the /system/lib library.
Reply all
Reply to author
Forward
0 new messages