compose-webview-multiplatform icon indicating copy to clipboard operation
compose-webview-multiplatform copied to clipboard

Proguard Optimization on Desktop fails

Open JuBan1 opened this issue 5 months ago • 1 comments

Hello there,

it appears that Proguard can't be used for code optimization with this library to optimize desktop JVM builds.

This can be reproduced by trying to package the sample app: ./gradlew :sample:desktopApp:packageReleaseUberJarForCurrentOS

This will fail with a compile-time error:

proguard.evaluation.exception.IncompleteClassHierarchyException:
[...]
Can't find common super class of [com.jetbrains.cef.remote.ThriftTransport$1] (with 1 known super classes: com.jetbrains.cef.remote.ThriftTransport$1 and 1 unknown classes: org.apache.thrift.transport.TServerTransport) and [com.jetbrains.cef.remote.ThriftTransport$2] (with 1 known super classes: com.jetbrains.cef.remote.ThriftTransport$2 and 1 unknown classes: org.apache.thrift.transport.TServerTransport)

Given the error message I assume that this ultimately comes from JCEF.

I tinkered for a few hours with proguard rules and found no way of making it run. -keeping or -dontwarning the relevant packages solved some issues but not all. Even keeping literally everything via ** still fails.

Only by adding -dontoptimize did it actually complete without errors. In this case you can still benefit from code shrinking.

I'm not sure how to even approach this issue since proguard rules don't appear to help.

JuBan1 avatar Jul 25 '25 08:07 JuBan1

I'm also experiencing this issue. -dontoptimize doesn't seem to make a difference though, nor does whether I'm compiling with a JCEF JDK or not. ~~I'll have to downgrade for now.~~ Thought it was working on a previous version but I'd misremembered, can't get proguard to work on any version I've tried.

toasterofbread avatar Oct 28 '25 22:10 toasterofbread