i want to use libzip.so in my ndk project,but i failed to load this lib.

154 views
Skip to first unread message

muyou43h

unread,
Jul 14, 2016, 10:47:02 AM7/14/16
to android-ndk
i want to use libzip.so  to read the files in my apk.


i use gradle-experimental:0.7.0  to configure my ndk development environment , so i do not have any makefile.

now , i have libzip.so and zip.h,how can i use them in my project?


i can use it by dlopen("libzip.so"),but i have to rewritten zip.h, like 

struct zip *(*open)(const char *, int, int *)


dlsym( libc, "zip_open" )


i have tried to fixed my build.gradle,



then ,i use "System.loadLibrary("zip")"  in my java file .but it do not work.


how can i load  libzip.so?



muyou43h

unread,
Jul 15, 2016, 12:32:54 PM7/15/16
to android-ndk
my libzip.so that i copy form others project is a lib of 32bit,but i need a 64bit lib.
i download the  Android NDK repackaging (for libzip 0.9.3) from https://nih.at/libzip/,.then put them in my jni file.

add #inlcude<stdint.h> in zipconfig,h ,then it works.

David

unread,
Jan 20, 2017, 2:02:25 AM1/20/17
to android-ndk, chengw...@gmail.com
Hi, I am trying to do the same thing. When you copied the files to the jni directory, did you make any other changes to the project? I am still getting "undefined reference to " errors when I try to build the project.
Reply all
Reply to author
Forward
0 new messages