When trying to use a base example to simply show a base map, the window pops up but the map never shows.
I'm currently on a Mac running Ventura with the below specs
I'm running in IntellJ, with Gradle configuration with the Azul zulu JDK17
Any help or insight would be great
Solved! Go to Solution.
I changed my base JDK (JAVA_HOME) to AzulJFX JDK 17, and I loaded the example from the above github example, set my api key in the gradle.properties, and was able to run the app from IntelliJ and the popup window opened and displayed the map fine. Still couldnt run the example from https://developers.arcgis.com/java/maps-2d/tutorials/display-a-map/
But got the solution I need to move forward based off of this example.
Just double checking - have you set your API key? (further below in the tutorial - Display a map | ArcGIS Maps SDK for Java | ArcGIS Developers)
Yes I did, I thought something might be up with my API key, so I used it in a codepen.io "Display a Map" example and it displayed on the web fine.
So I switched machines (a different Mac this one is a M1, with Java Azul JavaFX JDK 11) and I ran the following steps to just use a clone of an example
git clone https://github.com/Esri/arcgis-maps-sdk-java-samples.git
cd arcgis-maps-sdk-java-samples/map/display-map
gradle
gradle copyNatives
gradle run
And everything runs fine on that machine (window pops open and displays the map)
I switch back to the original Mac to go through the same steps and I get the following error
> Configure project :
Project : => no module-info.java found
> Task :run FAILED
2023-05-05 15:19:39.412 java[48567:646696] *** Assertion failure in -[_NSTrackingAreaAKViewHelper removeTrackingRect:], _NSTrackingAreaAKManager.m:1623
2023-05-05 15:19:39.474 java[48567:646696] *** 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 0x00007ff817d561ba __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007ff81787c42b objc_exception_throw + 48
2 Foundation 0x00007ff818c2beb8 -[NSCalendarDate initWithCoder:] + 0
3 AppKit 0x00007ff81b4213a5 -[_NSTrackingAreaAKViewHelper removeTrackingRect:] + 190
4 libglass.dylib 0x000000012b1f74e9 -[GlassViewDelegate setFrameSize:] + 361
5 libglass.dylib 0x000000012b1fcd68 -[GlassView3D setFrameSize:] + 88
6 AppKit 0x00007ff81adb05e1 -[NSView setFrame:] + 347
7 libglass.dylib 0x000000012b1fcdc5 -[GlassView3D setFrame:] + 69
8 AppKit 0x00007ff81adc13e4 -[NSView resizeWithOldSuperviewSize:] + 694
9 AppKit 0x00007ff81adc0d17 -[NSView resizeSubviewsWithOldSize:] + 499
10 AppKit 0x00007ff81ada0496 -[NSView setFrameSize:] + 1460
11 AppKit 0x00007ff81adb05e1 -[NSView setFrame:] + 347
12 AppKit 0x00007ff81adc13e4 -[NSView resizeWithOldSuperviewSize:] + 694
13 AppKit 0x00007ff81adc0d17 -[NSView resizeSubviewsWithOldSize:] + 499
14 AppKit 0x00007ff81ada0496 -[NSView setFrameSize:] + 1460
15 AppKit 0x00007ff81adbf120 -[NSThemeFrame setFrameSize:] + 464
16 AppKit 0x00007ff81adbe82b -[NSWindow _oldPlaceWindow:fromServer:] + 831
17 AppKit 0x00007ff81adbd2ca -[NSWindow _setFrameCommon:display:fromServer:] + 3045
18 libglass.dylib 0x000000012b1eeacf -[GlassWindow(Java) _setFlipFrame:display:animate:] + 239
19 libglass.dylib 0x000000012b1ee5cc -[GlassWindow(Java) _setWindowFrameWithRect:withDisplay:withAnimate:] + 268
20 libglass.dylib 0x000000012b1ee81b -[GlassWindow(Java) _setBounds:y:xSet:ySet:w:h:cw:ch:] + 571
21 libglass.dylib 0x000000012b2082fe Java_com_sun_glass_ui_mac_MacWindow__1setBounds2 + 446
22 ??? 0x0000000117914051 0x0 + 4690362449
23 ??? 0x000000011790fe9f 0x0 + 4690345631
24 ??? 0x000000011790fe9f 0x0 + 4690345631
25 ??? 0x000000011790fe9f 0x0 + 4690345631
26 ??? 0x00000001179102fb 0x0 + 4690346747
)
libc++abi: terminating due to uncaught exception of type NSException
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':run'.
> Process 'command '/usr/local/Cellar/openjdk/19.0.2/libexec/openjdk.jdk/Contents/Home/bin/java'' finished with non-zero exit value 134
I might try to use the same Azul JDK 11 version to see if the higher JDK is the problem...or just switch to Nasa Worldwind
Can you share your code and gradle script and I'll see if I can spot the problem (obfuscate your API key so you don't share it)
One thought is that IntelliJ has encouraged to you upgrade the slf4j version from what we've used in the tutorial. If you are using 2.x of slf4j you need to be witing a Java module system based app. If this is the case I can help.
For JDK I'd suggest using Adoptium 11 or 17 as in our system requirements.
Also take care that the JDK you are using is for the chipset of your machine. There are M1 and Intel specific JDKs and you need to get the right one.
The Maps SDK will work with either Intel or M1 based Macs
I changed my base JDK (JAVA_HOME) to AzulJFX JDK 17, and I loaded the example from the above github example, set my api key in the gradle.properties, and was able to run the app from IntelliJ and the popup window opened and displayed the map fine. Still couldnt run the example from https://developers.arcgis.com/java/maps-2d/tutorials/display-a-map/
But got the solution I need to move forward based off of this example.