Not Able To start my Javafx Application after obfuscation

i am new to proguard.

i have tried with two version of progaurd but got same result(proguard-7.3.2,proguard-7.4.0(beta01)

i am using progaurd to obfuscate my javafx application jar but after obfuscation i am not able to launch the application.

i am getting the error of

"Exception in thread “JavaFX Application Thread” Exception in thread “main” java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.NullPointerException
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:383)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
… 5 more
java.lang.VerifyError: Expecting a stackmap frame at branch target 15
Exception Details:
Location:
sample/Main.main([Ljava/lang/String;)V @0: getstatic
Reason:
Expected stackmap frame at this location.
Bytecode:
0x0000000: b200 1412 02b6 001a 2ab8 0024 a700 084c
0x0000010: 2bb6 001b b1
Exception Handler Table:
bci [0, 12] => handler: 15

    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplicationWithArgs$160(LauncherImpl.java:352)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$179(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$177(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$178(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$152(WinApplication.java:177)
    at java.lang.Thread.run(Unknown Source)"

although i have excluded all the package of my main method class (sample) also i have excluded all the imports i am using inside my main method from obfuscation.
but still i am getting the same issue .

i am sharing the configuration file also
progaurd configuration.txt (5.4 KB)

Hi @Satish_kumar,

Welcome to the Guardsquare community!

It looks related to Native Methods. Can you try keeping them like so?

-keepclasseswithmembernames class * {
    native <methods>;
}

You may also want to try keeping the javafx classes referenced:

-keep class com.sun.** { *; }
-keep class javafx.application.** { *; }
-keep class javafx.scene.** { *; }

I see you have many rules like these ones:

-keep class javafx.scene.layout.Region
-keep class javafx.scene.layout.VBox
-keep class javafx.scene.web.WebEngine

Please note, these rules will keep the class itself, but none of the members (e.g. methods or fields) so you may want to expand these rules more.

Finally you can try using -addconfigurationdebugging

https://www.guardsquare.com/manual/configuration/usage#addconfigurationdebugging

And see if it’s able to detect the issue and recommend a fine tuned -keep option for you.

Please let me know if anything is not clear.
Kind regards,
Jack