JavaFX application failing to launch on MacOS ventura with m2 chip. Assertion failure

315 Views Asked by At

I have a javaFX application which I am trying to launch in macOS ventura having m2 chip. I build the application in gradle 7.3.1 jdk 17.0.7 and javafx sdk 21. but when I go to launch it, it gives Assertion failure like below

   2023-09-26 21:06:14.194 java[42409:778654418] *** Assertion failure in -[_NSTrackingAreaAKViewHelper removeTrackingRect:], _NSTrackingAreaAKManager.m:1585
2023-09-26 21:06:14.196 java[42409:778654418] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '0x0 is an invalid NSTrackingRectTag. Common possible reasons for this are: 1. already removed this trackingRectTag, 2. Truncated the NSTrackingRectTag to 32bit at some point.'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007ff813fa5cd3 __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x00007ff813af610a objc_exception_throw + 48
    2   Foundation                          0x00007ff814d82fb0 -[NSCalendarDate initWithCoder:] + 0
    3   AppKit                              0x00007ff81763e562 -[_NSTrackingAreaAKViewHelper removeTrackingRect:] + 190
    4   libglass.dylib                      0x00000001099f068a -[GlassViewDelegate setFrameSize:] + 362
    5   libglass.dylib                      0x00000001099f5fb8 -[GlassView3D setFrameSize:] + 88
    6   AppKit                              0x00007ff816fca3a1 -[NSView setFrame:] + 347
    7   libglass.dylib                      0x00000001099f6011 -[GlassView3D setFrame:] + 65
    8   AppKit                              0x00007ff816fdb0f9 -[NSView resizeWithOldSuperviewSize:] + 694
    9   AppKit                              0x00007ff816fdaa2a -[NSView resizeSubviewsWithOldSize:] + 488
    10  AppKit                              0x00007ff816fba206 -[NSView setFrameSize:] + 1446
    11  AppKit                              0x00007ff816fca3a1 -[NSView setFrame:] + 347
    12  AppKit                              0x00007ff816fdb0f9 -[NSView resizeWithOldSuperviewSize:] + 694
    13  AppKit                              0x00007ff816fdaa2a -[NSView resizeSubviewsWithOldSize:] + 488
    14  AppKit                              0x00007ff816fba206 -[NSView setFrameSize:] + 1446
    15  AppKit                              0x00007ff816fd8e2d -[NSThemeFrame setFrameSize:] + 482
    16  AppKit                              0x00007ff816fd84f4 -[NSWindow _oldPlaceWindow:fromServer:] + 813
    17  AppKit                              0x00007ff816fd6ae5 -[NSWindow _setFrameCommon:display:fromServer:] + 1656
    18  libglass.dylib                      0x00000001099e7c24 -[GlassWindow(Java) _setFlipFrame:display:animate:] + 228
    19  libglass.dylib                      0x00000001099e776f -[GlassWindow(Java) _setWindowFrameWithRect:withDisplay:withAnimate:] + 255
    20  libglass.dylib                      0x00000001099e79d9 -[GlassWindow(Java) _setBounds:y:xSet:ySet:w:h:cw:ch:] + 601
    21  libglass.dylib                      0x0000000109a01353 Java_com_sun_glass_ui_mac_MacWindow__1setBounds2 + 435
    22  ???                                 0x0000000116ebf365 0x0 + 4679529317
)
libc++abi: terminating with uncaught exception of type NSException
/Applications/InBetween_j17/Admin/IBAdmin.command: line 3: 42409 Abort trap: 6           ../Libraries/jre/bin/java -Xms1024m -Xmx4096m -Dlog4j.configurationFile=file://"`dirname "$0"`"/log4j2.xml -Djava.security.policy=java.policy -Dprism.order=sw,j2d --module-path "../Libraries/javafx/lib" --add-modules javafx.controls,javafx.fxml -classpath ./*:../Libraries/Core/IBCommon.jar:../Libraries/Core/IBStubs.jar:../Libraries/Core/IBCore.jar:../Libraries/Core/core.jar:../Libraries/lib/* -Xdock:icon=./IBAdmin.app/Contents/Resources/IB_Admin.icns application.IBAdmin

It works fine on other macs with m1 chips or any other chips. does any one have any clue as how to solve this, I tried compiling with all the javafx sdks since 17. It was working fine with jdk 11 and javafx sdk 11. but we are now migrating everything to Java 17. and other latest versions.

1

There are 1 best solutions below

1
sogytots On

I was able to solve this by upgrading to jdk21 and using the openjfx 21 aarch64 libs. and also removed the j2d rendering pipeline, as its deprecated. I am just using sw now.

Also following flags were added in the command.

-Djava.security.policy=java.policy -Djava.library.path="../Libraries/javafx/lib" -Dprism.order=sw -Dprism.verbose=true --module-path "../Libraries/javafx/lib" --add-modules javafx.controls,javafx.base,javafx.fxml,javafx.graphics,javafx.media,javafx.web --add-opens=javafx.graphics/javafx.scene=ALL-UNNAMED --add-exports javafx.base/com.sun.javafx.event=ALL-UNNAMED