Unable to dlopen(/system/lib/libQtWebKit.so): Cannot load library: link_image[2046]

228 views
Skip to first unread message

Sunil

unread,
Dec 30, 2010, 7:14:04 AM12/30/10
to android-qt
Hi,
first of all thanks for all the efforts to make qt work on Android!

I managed to build qt libs on top of NDK-r5 and able to install/run
any qt example based on QtGui,etc on Android 2.2
But when I enable webkit in the androidconfig.sh and run fancybrowser
example, the webkit library doesn't load and fails with the following
error,
....
D/dalvikvm( 1909): No JNI_OnLoad found in /system/lib/libQtCore.so
0x43ec3300, skipping init
D/dalvikvm( 1909): No JNI_OnLoad found in /system/lib/libQtXml.so
0x43ec3300, skipping init
D/dalvikvm( 1909): No JNI_OnLoad found in /system/lib/libQtNetwork.so
0x43ec3300, skipping init
D/dalvikvm( 1909): No JNI_OnLoad found in /system/lib/libQtSql.so
0x43ec3300, skipping init
D/dalvikvm( 1909): No JNI_OnLoad found in /system/lib/libQtGui.so
0x43ec3300, skipping init
D/dalvikvm( 1909): No JNI_OnLoad found in /system/lib/libQtOpenGL.so
0x43ec3300, skipping init
D/dalvikvm( 1909): No JNI_OnLoad found in /system/lib/libQtSvg.so
0x43ec3300, skipping init
D/dalvikvm( 1909): No JNI_OnLoad found in /system/lib/
libQtMultimedia.so 0x43ec3300, skipping init
D/dalvikvm( 1909): No JNI_OnLoad found in /system/lib/
libQtXmlPatterns.so 0x43ec3300, skipping init
I/Qt ( 1909): qt start
I/dalvikvm( 1909): Unable to dlopen(/system/lib/libQtWebKit.so):
Cannot load library: link_image[2046]: failed to link libQtWebKit.so
I/dalvikvm( 1909):
D/AndroidRuntime( 1909): Shutting down VM
W/dalvikvm( 1909): threadid=1: thread exiting with uncaught exception
(group=0x4001d820)
E/AndroidRuntime( 1909): FATAL EXCEPTION: main
E/AndroidRuntime( 1909): java.lang.UnsatisfiedLinkError: Library /
system/lib/libQtWebKit.so not found
E/AndroidRuntime( 1909): at java.lang.Runtime.load(Runtime.java:409)
E/AndroidRuntime( 1909): at java.lang.System.load(System.java:536)
E/AndroidRuntime( 1909): at
com.nokia.qt.android.QtApplication.loadLibraries(QtApplication.java:
197)
E/AndroidRuntime( 1909): at
com.nokia.qt.android.QtActivity.onCreate(QtActivity.java:227)
E/AndroidRuntime( 1909): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1047)
E/AndroidRuntime( 1909): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2627)
E/AndroidRuntime( 1909): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2679)
E/AndroidRuntime( 1909): at android.app.ActivityThread.access
$2300(ActivityThread.java:125)
E/AndroidRuntime( 1909): at android.app.ActivityThread
$H.handleMessage(ActivityThread.java:2033)
E/AndroidRuntime( 1909): at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 1909): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 1909): at
android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime( 1909): at
java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1909): at
java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 1909): at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime( 1909): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime( 1909): at dalvik.system.NativeStart.main(Native
Method)
I/Process ( 1909): Sending signal. PID: 1909 SIG: 9

I copied the libs to /system/lib folder assuming they may solve the
problem, but still no luck.

Does anybody managed to run qt webkit based application using latest
android-lighthouse built on top of NDK-r5 ??

Thanks for your time in advance.

-Sunil

Sergey A. Galin

unread,
Dec 30, 2010, 7:24:35 AM12/30/10
to android-qt
Hi Sunil,

Make sure you have compiled (you had to remove "-no-webkit" from
androidconfig.sh) libQtWebkit.so and pushed it to device.

Regards,
Sergey

Sunil

unread,
Dec 31, 2010, 2:29:39 AM12/31/10
to android-qt
Hi Sergy,

The library libQtWebKit.so is actually present in the specified path,
otherwise it will not be loaded because of f.exists() check code in
QtApplication.java,
String library = "/system/lib/lib" + libraries.get(i) + ".so";
File f = new File(library);
if (f.exists())
System.load(library);

strangely the webkit library version is 4.7.2 whereas all other
libraries built as 4.8.0

Did you tried to running any webkit example on your side and saw that
it works?

-Sunil

Sergey A. Galin

unread,
Dec 31, 2010, 4:27:15 AM12/31/10
to andro...@googlegroups.com
Hi Sunil,

Sorry, I didn't ever used WebKit myself, only read in the list that it
works for someone :-)

The error message can mean 2 things: (a) the library itself is not
there, or (b) it fails linking with another native libraries. Use
"arm-eabi-objdump -p libWebKit.so" (arm-eabi-objdump is somehere in NDK)
to check on which Qt libraries it depends. Push these libraries to
device and make sure Java loads them BEFORE libWebKit.so, or reconfigure
and rebuild Qt to not use these libs at all. I just checked desktop Qt
lib (I don't have a version for Android at hand) and it indicated that
WebKit depends on sqlite and Phonon:

$ objdump -p /usr/lib/libQtWebKit.so

...
NEEDED libsqlite3.so.0
NEEDED libphonon.so.4
NEEDED libQtGui.so.4
NEEDED libQtNetwork.so.4
NEEDED libQtCore.so.4
...


--
Best regards,
Sergey A.Galin


Reply all
Reply to author
Forward
0 new messages