Skip to content

Configure minify task using proguard

Sebastian requested to merge 141-minify-using-proguard into main

Closes #141

Create minified jar using ./gradlew minify --info

Currently the resulting jar is about 50Mb 53Mb instead of 94Mb

With the current rules defined in proguard-rules.pro the app runs without problems.

With the current rules defined in proguard-rules.pro the app even starts.

It displays a stacktrace which doesn't make it crash yet though:

java.lang.NoSuchMethodError: <init>
        at org.jetbrains.skia.impl.Library._nAfterLoad(Native Method)
        at org.jetbrains.skia.impl.Library$Companion._nAfterLoad(Library.jvm.kt)
        at org.jetbrains.skiko.Library.load(Library.kt:66)
        at org.jetbrains.skia.impl.Library$Companion.staticLoad(Library.jvm.kt:12)
        at org.jetbrains.skia.Data.<clinit>(Data.kt:60)
        at androidx.compose.ui.res.DesktopSvgResources_desktopKt.loadSvgPainter(DesktopSvgResources.desktop.kt:55)
        at androidx.compose.ui.res.PainterResources_desktopKt.rememberSvgResource(PainterResources.desktop.kt:82)
        at androidx.compose.ui.res.PainterResources_desktopKt.painterResource(PainterResources.desktop.kt:68)
        at androidx.compose.ui.res.PainterResources_desktopKt.painterResource(PainterResources.desktop.kt:57)
        at org.briarproject.briar.desktop.ui.BriarUiImpl.start(BriarUi.kt:114)
        at org.briarproject.briar.desktop.Main$run$6.invoke(Main.kt:114)
        at org.briarproject.briar.desktop.Main$run$6.invoke(Main.kt:113)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:116)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.ui.window.Application_desktopKt$application$1$1.invoke(Application.desktop.kt:116)

However as soon as I start typing something into the password text input, the app crashes with a fatal error, writing a core dump to a hs_err_pid*.log file.

Here's the topmost part of that log:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fe9ed4ec479, pid=382910, tid=382944
#
# JRE version: OpenJDK Runtime Environment (11.0.11+9) (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
# Java VM: OpenJDK 64-Bit Server VM (11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x8d8479]
#
# Core dump will be written. Default location: Core dumps may be processed with "/lib/systemd/systemd-coredump %P %u %g %s %t 9223372036854775808 %h" (or dumping to /h
ome/z/gitlab/briar/briar-desktop3/core.382910)
#
# If you would like to submit a bug report, please visit:
#   https://bugs.launchpad.net/ubuntu/+source/openjdk-lts
#

---------------  S U M M A R Y ------------

Command Line: build/compose/jars/Briar-linux-x64-0.1.0-snapshot.min.jar

Host: Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz, 12 cores, 31G, Linux Mint 20 Ulyana
Time: Tue Feb  1 17:00:15 2022 CET elapsed time: 9.955754 seconds (0d 0h 0m 9s)

---------------  T H R E A D  ---------------

Current thread (0x00007fe9e873c800):  JavaThread "AWT-EventQueue-0" [_thread_in_vm, id=382944, stack(0x00007fe94d82a000,0x00007fe94d92b000)]

Stack: [0x00007fe94d82a000,0x00007fe94d92b000],  sp=0x00007fe94d922ac0,  free space=994k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x8d8479]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.jetbrains.skia.paragraph.ParagraphKt._nGetRectsForRange(JIIII)Ljava/lang/Object;+0
j  org.jetbrains.skia.paragraph.ParagraphKt.access$_nGetRectsForRange(JIIII)Ljava/lang/Object;+7
j  org.jetbrains.skia.paragraph.Paragraph.getRectsForRange(IILorg/jetbrains/skia/paragraph/RectHeightMode;Lorg/jetbrains/skia/paragraph/RectWidthMode;)[Lorg/jetbrains/
skia/paragraph/TextBox;+53
j  androidx.compose.ui.text.platform.SkiaParagraph.getBoxBackwardByOffset(II)Lorg/jetbrains/skia/paragraph/TextBox;+20
j  androidx.compose.ui.text.platform.SkiaParagraph.getBoxBackwardByOffset$default(Landroidx/compose/ui/text/platform/SkiaParagraph;IIILjava/lang/Object;)Lorg/jetbrains
/skia/paragraph/TextBox;+11
j  androidx.compose.ui.text.platform.SkiaParagraph.getHorizontalPosition(IZ)F+5
j  androidx.compose.ui.text.platform.SkiaParagraph.getCursorRect(I)Landroidx/compose/ui/geometry/Rect;+3
j  androidx.compose.ui.text.MultiParagraph.getCursorRect(I)Landroidx/compose/ui/geometry/Rect;+62
j  androidx.compose.ui.text.TextLayoutResult.getCursorRect(I)Landroidx/compose/ui/geometry/Rect;+5
j  androidx.compose.foundation.text.TextFieldScrollKt.getCursorRectInScroller(Landroidx/compose/ui/unit/Density;ILandroidx/compose/ui/text/input/TransformedText;Landro
idx/compose/ui/text/TextLayoutResult;ZI)Landroidx/compose/ui/geometry/Rect;+20
j  androidx.compose.foundation.text.TextFieldScrollKt.access$getCursorRectInScroller(Landroidx/compose/ui/unit/Density;ILandroidx/compose/ui/text/input/TransformedText
;Landroidx/compose/ui/text/TextLayoutResult;ZI)Landroidx/compose/ui/geometry/Rect;+8
Edited by Sebastian

Merge request reports