V8 library is not loaded 'System.loadLibrary()' ...

167 views
Skip to first unread message

locci

unread,
Jul 1, 2010, 10:52:53 PM7/1/10
to android-ndk
Hi all.

I'm test V8 javascript Engine.

I build V8 static library on ubuntu.
setting the environment like this:
export TOP=/mnt/ExtHdd/mydroid
export TOOL_CHAIN=$TOP/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0
export AR=$TOOL_CHAIN/bin/arm-eabi-ar
export CXX=$TOOL_CHAIN/bin/arm-eabi-g++
export CC=$TOOL_CHAIN/bin/arm-eabi-gcc
export RANLIB=$TOOL_CHAIN/bin/arm-eabi-ranlib

and, build V8 static library
# scons mode=debug sanpshot=off library=static importenv=TOP
arch=arm os=android.

it's quite good build, and built the 'libv8.a'.

And.. next, i'm using the NDK building libV8JSE-jni.so. 'Android.mk'
like this :
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_CPP_EXTENSION := .cc
LOCAL_MODULE := V8JSE-jni
LOCAL_SRC_FILES := shell.cc
LOCAL_STATIC_LIBRARIES := libv8
LOCAL_LDLIBS := -llog
include $(BUILD_SHARED_LIBRARY)

libV8JSE-jni.so is quite good builing.

And, I'm importing this library in my test app.
using this code : System.loadLibrary("V8JSE-jni");
But, libV8JSE-jni.so is not loading. loading fail. and, application is
exit.

So, i'm download full source android froyo, and full builing. It makes
libv8.a.
And, i changed the that libv8.a in my NDK.
Then, loadLibrary is suceed.

Why do this? Is any different? or, i missing something?
Do you have any idea??



David Turner

unread,
Jul 2, 2010, 12:47:05 AM7/2/10
to andro...@googlegroups.com
Most probably, your scons rules are broken and do not generate a proper binary.
There are subtle issues (e.g. compiler/linker flags) that must be dealt with, and you
cannot simply invoke arm-eabi-gcc and expect something adequate.

For now, you will really need to build libv8.a with the NDK or the Android build system
because they take care of all the ugly details for you.



--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


Reply all
Reply to author
Forward
0 new messages