entylop / protobuf

Automatically exported from code.google.com/p/protobuf
Other
0 stars 0 forks source link

protobuf shared library can not work correctly on Android 2.1(NDK),2.2 (NDK) , but it can work well on Android 2.3(NDK). #325

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.I compiled protobuf(version 2.4.1) to libprotubuf.so with 
NDKr5+cygwin+windows XP.
2.In java code, load this libprotobuf.so like this:   
System.loadLibrary("protobuffull");
3.run my test code to use protobuf.

What is the expected output? What do you see instead?
When I run my test code in android 2.3, it worked very well, load 
libprotobuf.so and then run my test code correctly.
But when I run the code in android 2.1, I found that I can't load 
libprotobuf.so. The logcat showed that it stopped when I try to load 
libprotubuf.so .

What version of the product are you using? On what operating system?
the version of protobuf is 2.4.1, the cell phone os is android 2.1 ,2.2 and 2.3.

Please provide any additional information below.
1. Android.mk:

...
...
..
                google/protobuf/io/zero_copy_stream_impl.cc \
                   google/protobuf/io/zero_copy_stream_impl_lite.cc 

LOCAL_CPP_EXTENSION := .cc

LOCAL_C_INCLUDES := $(LOCAL_PATH)/google/protobuf/io \
                    $(LOCAL_PATH)/google/protobuf/stubs \
                    $(LOCAL_PATH)/google/protobuf \
                    $(LOCAL_PATH)/google/protobuf/compiler \
                    $(LOCAL_PATH)
LOCAL_LDLIBS := -lz                

include $(BUILD_SHARED_LIBRARY)

2. load the shared lib in java code :

System.loadLibrary("protobuffull"); //(it doesn't work in android 2.1 2.2 cell 
phone, but it works well in android 2.3 cell phone)

Original issue reported on code.google.com by nki...@gmail.com on 23 Aug 2011 at 6:39

GoogleCodeExporter commented 9 years ago
We don't have android environment for testing and can't help users diagnose 
problems on android platforms. It would be appreciated if you can find out the 
root cause and submit us a patch.

Original comment by xiaof...@google.com on 10 Oct 2014 at 1:30