Bug 134846 - apk package is broken
Summary: apk package is broken
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Android Viewer (show other bugs)
Version:
(earliest affected)
7.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Michael Weghorn
URL:
Whiteboard: target:7.1.0
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-16 01:45 UTC by baffclan
Modified: 2020-07-20 23:34 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description baffclan 2020-07-16 01:45:48 UTC
Description:
apk package is broken


Steps to Reproduce:
1. download a apk package(daily/master/Android-ARM@86-TDF)
2. install apk package
3. run LibreOffice Viewer
4. tap a odf file


Actual Results:
Crash a LibreOffcie Viewer


Expected Results:
Open a odt file



Reproducible: Always


User Profile Reset: No



Additional Info:
Good: 
Android-ARM@86-TDF / 2020-07-02_15.32.14
Version: 7.1.0.0.alpha0+
BuildID: 656fd1e

Broken: 
Android-ARM@86-TDF / 2020-07-08_12.50.23
Version: 7.1.0.0.alpha0+
BuildID: a7350a3


Date: 2020-07-06_22.24.08
File Size: 69950664

Date: 2020-07-15_10.58.22
File Size: 13212930

Too small?
Comment 1 Michael Weghorn 2020-07-17 06:14:08 UTC
Crash when opening an ODT file reproduced with current daily build "android~2020-07-17_01.14.12_LibreOfficeViewer-strippedUIEditing-debug.apk":

Version: 7.1.0.alpha0+
Build ID: a3e52f6

ADB logcat output contains this:

07-17 08:12:03.142 23785 23785 E AndroidRuntime: FATAL EXCEPTION: main
07-17 08:12:03.142 23785 23785 E AndroidRuntime: Process: org.example.libreoffice, PID: 23785
07-17 08:12:03.142 23785 23785 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.example.libreoffice-oWIFy_eU7DU072HlUBKt7g==/base.apk"],nativeLibraryDirectories=[/data/app/org.example.libreoffice-oWIFy_eU7DU072HlUBKt7g==/lib/arm64, /system/lib64, /system/vendor/lib64]]] couldn't find "libnspr4.so"
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at java.lang.Runtime.loadLibrary0(Runtime.java:1012)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at java.lang.System.loadLibrary(System.java:1669)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at org.libreoffice.kit.NativeLibLoader.load(LibreOfficeKit.java:92)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at org.libreoffice.kit.LibreOfficeKit.<clinit>(LibreOfficeKit.java:82)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at org.libreoffice.kit.LibreOfficeKit.initializeLibrary(LibreOfficeKit.java:35)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at org.libreoffice.TileProviderFactory.initialize(TileProviderFactory.java:23)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at org.libreoffice.LOKitThread.<init>(LOKitThread.java:40)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at org.libreoffice.LibreOfficeMainActivity.onCreate(LibreOfficeMainActivity.java:159)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at android.app.Activity.performCreate(Activity.java:7327)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at android.app.Activity.performCreate(Activity.java:7318)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1275)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3101)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3264)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1955)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:106)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:214)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7078)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
07-17 08:12:03.142 23785 23785 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)
Comment 2 Michael Weghorn 2020-07-17 11:57:44 UTC
Thanks to the really helpful information in the bug report, it was quite easy to find the relevant commit at which this most probably regressed.

Fix pending here: https://gerrit.libreoffice.org/c/core/+/98970

The APK built using 'gradlew' or from Android Studio is fine again for me with that change in place.

Side note: For some reason still unknown to me, just clicking "Run" in Android Studio to deploy the app directly to a device/AVD still does not include the native libraries, but that might be a different issue (or something's broken in my Android Studio setup...).
Comment 3 Michael Weghorn 2020-07-17 12:05:24 UTC
(In reply to Michael Weghorn from comment #2)
> Side note: For some reason still unknown to me, just clicking "Run" in
> Android Studio to deploy the app directly to a device/AVD still does not
> include the native libraries, but that might be a different issue (or
> something's broken in my Android Studio setup...).

Turned out that the AVD is an x86_64 one and the build was for x86, so Android Studio decided not to ship the x86 libraries since it's another architecture - while using an APK containing x86 libs naturally just works. (I think that used to be different previously, but anyway, it's not relevant here...)
Comment 4 Commit Notification 2020-07-17 12:36:07 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/bc6c034ba0bc163bfd6f437582ee3dbdcffbe81f

tdf#134846 Android Viewer: Include native libs again

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 baffclan 2020-07-20 23:34:14 UTC
Cannot reproduce new build.

Android-ARM@86-TDF / 2020-07-20_04.01.00
Version: 7.1.0.0.alpha0+
BuildID: 856f0f2

Thanks for fixing this!

-> v.