From 7084da45dd322c253626c3576aef53ae021fdcdf Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Thu, 21 Apr 2022 14:16:30 +0200 Subject: [PATCH] android: Explicitly load libc++_shared While it works just fine without that in newer Android versions, trying to open any doc in an x86 AVD with API level 16 failed like this: > E/AndroidRuntime( 2999): java.lang.ExceptionInInitializerError > E/AndroidRuntime( 2999): at org.libreoffice.TileProviderFactory.initialize(TileProviderFactory.java:23) > E/AndroidRuntime( 2999): at org.libreoffice.LOKitThread.(LOKitThread.java:39) > E/AndroidRuntime( 2999): at org.libreoffice.LibreOfficeMainActivity.onCreate(LibreOfficeMainActivity.java:149) > E/AndroidRuntime( 2999): at android.app.Activity.performCreate(Activity.java:5008) > E/AndroidRuntime( 2999): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) > E/AndroidRuntime( 2999): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023) > E/AndroidRuntime( 2999): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) > E/AndroidRuntime( 2999): at android.app.ActivityThread.access$600(ActivityThread.java:130) > E/AndroidRuntime( 2999): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) > E/AndroidRuntime( 2999): at android.os.Handler.dispatchMessage(Handler.java:99) > E/AndroidRuntime( 2999): at android.os.Looper.loop(Looper.java:137) > E/AndroidRuntime( 2999): at android.app.ActivityThread.main(ActivityThread.java:4745) > E/AndroidRuntime( 2999): at java.lang.reflect.Method.invokeNative(Native Method) > E/AndroidRuntime( 2999): at java.lang.reflect.Method.invoke(Method.java:511) > E/AndroidRuntime( 2999): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) > E/AndroidRuntime( 2999): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) > E/AndroidRuntime( 2999): at dalvik.system.NativeStart.main(Native Method) > E/AndroidRuntime( 2999): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1891]: 1176 could not load needed library 'libc++_shared.so' for 'liblo-native-code.so' (load_library[1093]: Library 'libc++_shared.so' not found) > E/AndroidRuntime( 2999): at java.lang.Runtime.loadLibrary(Runtime.java:370) > E/AndroidRuntime( 2999): at java.lang.System.loadLibrary(System.java:535) > E/AndroidRuntime( 2999): at org.libreoffice.kit.NativeLibLoader.load(LibreOfficeKit.java:105) > E/AndroidRuntime( 2999): at org.libreoffice.kit.LibreOfficeKit.(LibreOfficeKit.java:82) > E/AndroidRuntime( 2999): ... 17 more > W/ActivityManager( 1421): Force finishing activity org.libreoffice/.LibreOfficeMainActivity > W/ActivityManager( 1421): Force finishing activity org.libreoffice/.ui.LibreOfficeUIActivity Change-Id: I6e383e624b9e66c0daa9ecfda4a3b176c8fa0d94 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133263 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java | 1 + 1 file changed, 1 insertion(+) diff --git a/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java b/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java index f6658d64806a..f7597c29a86c 100644 --- a/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java +++ b/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java @@ -102,6 +102,7 @@ class NativeLibLoader { System.loadLibrary("smime3"); System.loadLibrary("ssl3"); + System.loadLibrary("c++_shared"); System.loadLibrary("lo-native-code"); done = true; }