Sebastian Kürten
02/01/2022, 11:48 AMval packageUberJarForCurrentOS by getting
mcpiroman
02/01/2022, 12:03 PMval packageUberJarForCurrentOS by tasks.getting
. I'm not sure how it is supposed to work without tasks.
but OTOH I've seen such examples.Sebastian Kürten
02/01/2022, 12:52 PMmcpiroman
02/01/2022, 1:39 PMmcpiroman
02/01/2022, 2:14 PMSebastian Kürten
02/01/2022, 3:35 PMSebastian Kürten
02/01/2022, 3:37 PM-keep
rules that are typically required in order for compose, skia et al to keep workingSebastian Kürten
02/01/2022, 3:37 PMjava.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)
and I haven't yet figured out what to doJames Hamilton
02/01/2022, 3:42 PMSebastian Kürten
02/02/2022, 11:06 AM-dontoptimize
-dontobfuscate
-dontwarn org.jetbrains.skiko.**
-dontwarn org.jetbrains.skia.**
-dontwarn kotlinx.**
-keepdirectories **
-keepattributes InnerClasses
-keepclasseswithmembers public class de.mobanisto.test.MainKt {
public static void main(java.lang.String[]);
}
-keepclasseswithmembers class org.jetbrains.skia.** { *; }
-keepclasseswithmembers class org.jetbrains.skiko.** { *; }
-keep class * implements org.jetbrains.skia.shaper.RunHandler { *; }
-keep class com.sun.jna.** { *; }
-keep class * implements com.sun.jna.** { *; }
the app seems to run fine with that. I still get this stacktrace during start up, which doesn't seem to to any harm though:
java.lang.NoSuchMethodError: commitLine
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.skiko.SkiaLayer.<clinit>(SkiaLayer.jvm.kt:29)
at androidx.compose.ui.awt.ComposeLayer.<init>(ComposeLayer.desktop.kt:73)
at androidx.compose.ui.awt.ComposeWindowDelegate.<init>(ComposeWindowDelegate.desktop.kt:44)
at androidx.compose.ui.awt.ComposeWindow.<init>(ComposeWindow.desktop.kt:47)
at androidx.compose.ui.awt.ComposeWindow.<init>(ComposeWindow.desktop.kt:44)
at androidx.compose.ui.window.Window_desktopKt$Window$3.invoke(Window.desktop.kt:161)
at androidx.compose.ui.window.Window_desktopKt$Window$3.invoke(Window.desktop.kt:156)
at androidx.compose.ui.window.Window_desktopKt$Window$10$1.invoke(Window.desktop.kt:367)
at androidx.compose.ui.window.Window_desktopKt$Window$10$1.invoke(Window.desktop.kt:366)
at androidx.compose.ui.window.AwtWindow_desktopKt$AwtWindow$2.invoke(AwtWindow.desktop.kt:75)
at androidx.compose.ui.window.AwtWindow_desktopKt$AwtWindow$2.invoke(AwtWindow.desktop.kt:74)
at androidx.compose.runtime.DisposableEffectImpl.onRemembered(Effects.kt:81)
at androidx.compose.runtime.CompositionImpl$RememberEventDispatcher.dispatchRememberObservers(Composition.kt:802)
at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:647)
at androidx.compose.runtime.Recomposer.composeInitial$runtime(Recomposer.kt:763)
at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:433)
at androidx.compose.ui.window.Application_desktopKt$awaitApplication$2$1$2.invokeSuspend(Application.desktop.kt:220)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
would still be nice to find out what's going on there.
I've set up a minimalistic project for testing this. Also created a ticket there:
https://github.com/sebkur/test-proguard/issues/1Sebastian Kürten
02/02/2022, 5:49 PM-keepclasseswithmembers,includedescriptorclasses class *
-keepclasseswithmembers,includedescriptorclasses class * {*;}
-keepclasseswithmembers,includedescriptorclasses class **,** {*;}
-keepclasseswithmembers,includedescriptorclasses interface **,** {*;}
-keepclasseswithmembers,includedescriptorclasses enum **,** {*;}
that exception still keeps coming up. The resulting jar definitely contains all the classes the original one does (although they're all smaller, so proguard apparently still did something to them. whatever it is, it looks like it's the cause for the exception)James Hamilton
02/02/2022, 6:08 PM-keep class org.jetbrains.skia.shaper.RunHandler {
public <methods>;
}
Sebastian Kürten
02/02/2022, 6:49 PM-keep
vs -keepclasseswithmembers
Sebastian Kürten
02/03/2022, 10:21 AMBtw are you going to use native distribution with it? I'd like to do that but looks not possible (easily) with the described approach.We probably need to change the input for the native distribution tasks. Not sure if thats possible. Maybe a workaround could be to let the proguard task replace the unminified jar with the minified one when it's done?
mcpiroman
02/03/2022, 9:06 PMJames Hamilton
02/04/2022, 3:55 PM