<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Mobile Map Package mmpk File Loads Sometimes But Not Always in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/mobile-map-package-mmpk-file-loads-sometimes-but/m-p/735465#M2213</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having an issue with loading an mmpk ( i think). Some times it will load, sometimes it will&amp;nbsp;fail, and sometimes it will hang. I haven't been able to figure out what is causing this as I can run the project a few times in a row and get different results, without changing any code between runs. I am very new to the java SDK and I'm trying to teach myself with the tutorials. I combined two tutorials, find route and get a route and directions offline, into one project to try to get turn by turn directions from an mmpk file. Both tutorials work fine on their own. Here's most of my code. When it actually loads, it mostly works (I'm still working on getting the find and reset buttons to work for point and click start and end points) I have notated what line is indicated by the error message.&lt;/P&gt;&lt;P&gt;When it fails/hangs the outputs I have included are:&lt;/P&gt;&lt;P&gt;Start Function&lt;BR /&gt;SetupMobileMap Function&lt;BR /&gt;Exit SetupMobileMap Function&lt;BR /&gt;SetupGraphicsOverlay Function&lt;BR /&gt;exit start&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error message is:&lt;/P&gt;&lt;P&gt;Exception in thread "JavaFX Application Thread" com.esri.arcgisruntime.ArcGISRuntimeException: Invalid argument: Null value.&lt;BR /&gt; at com.esri.arcgisruntime.internal.jni.CoreMobileMapPackage.nativeGetLoadStatus(Native Method)&lt;BR /&gt; at com.esri.arcgisruntime.internal.jni.CoreMobileMapPackage.getLoadStatus(CoreMobileMapPackage.java:142)&lt;BR /&gt; at com.esri.arcgisruntime.internal.loadable.LoadableImpl.getLoadStatus(LoadableImpl.java:125)&lt;BR /&gt; at com.esri.arcgisruntime.mapping.MobileMapPackage.getLoadStatus(MobileMapPackage.java:326)&lt;BR /&gt; at TurnByTurn.lambda$setupMobileMap$1(TurnByTurn.java:134)&lt;BR /&gt; at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)&lt;BR /&gt; at java.base/java.security.AccessController.doPrivileged(Native Method)&lt;BR /&gt; at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)&lt;BR /&gt; at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)&lt;BR /&gt; at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)&lt;BR /&gt; at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)&lt;BR /&gt; at java.base/java.lang.Thread.run(Thread.java:834)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When it loads the outputs are:&lt;/P&gt;&lt;P&gt;Start Function&lt;BR /&gt;SetupMobileMap Function&lt;BR /&gt;Exit SetupMobileMap Function&lt;BR /&gt;SetupGraphicsOverlay Function&lt;BR /&gt;exit start&lt;BR /&gt;LOADED&lt;BR /&gt;2&lt;BR /&gt;Calling setupRouteTask&lt;BR /&gt;SetupRouteTask Function&lt;BR /&gt;Licensed For Developer Use Only&lt;BR /&gt;CreateRouteAndDisplay Function&lt;BR /&gt;SolveForRoute Function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help with this would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;@Override
public void &lt;/SPAN&gt;start ( Stage stage )
{
    System.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;out&lt;/SPAN&gt;.println( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Start Function" &lt;/SPAN&gt;);

    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;stackPane &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;StackPane(  );
    Scene scene = &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Scene( &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;stackPane &lt;/SPAN&gt;);

    stage.setTitle( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Navigation" &lt;/SPAN&gt;);
    stage.setWidth( &lt;SPAN style="color: #0000ff;"&gt;800 &lt;/SPAN&gt;);
    stage.setHeight( &lt;SPAN style="color: #0000ff;"&gt;700 &lt;/SPAN&gt;);
    stage.show();
    stage.setScene( scene );


    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;controlsVBox &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;VBox(&lt;SPAN style="color: #0000ff;"&gt;6&lt;/SPAN&gt;);
    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;controlsVBox&lt;/SPAN&gt;.setBackground( &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Background( &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;BackgroundFill( Paint.&lt;SPAN&gt;valueOf&lt;/SPAN&gt;( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"rgba(0,0,0,0.3)" &lt;/SPAN&gt;),
            CornerRadii.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;EMPTY&lt;/SPAN&gt;, Insets.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;EMPTY &lt;/SPAN&gt;) ) );
    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;controlsVBox&lt;/SPAN&gt;.setPadding( &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Insets( &lt;SPAN style="color: #0000ff;"&gt;10.0 &lt;/SPAN&gt;) );
    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;controlsVBox&lt;/SPAN&gt;.setMaxSize( &lt;SPAN style="color: #0000ff;"&gt;400&lt;/SPAN&gt;,&lt;SPAN style="color: #0000ff;"&gt;300 &lt;/SPAN&gt;);
    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;controlsVBox&lt;/SPAN&gt;.getStyleClass().add( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"panel-region" &lt;/SPAN&gt;);

    Label directionsLabel = &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Label(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Route directions"&lt;/SPAN&gt;);
    directionsLabel.getStyleClass().add( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"panel-label" &lt;/SPAN&gt;);

    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;findButton &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Button(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Find Route"&lt;/SPAN&gt;);
    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;findButton&lt;/SPAN&gt;.setMaxWidth( Double.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;MAX_VALUE  &lt;/SPAN&gt;);
    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;findButton&lt;/SPAN&gt;.setDisable( &lt;SPAN style="color: #000080; font-weight: bold;"&gt;true &lt;/SPAN&gt;);

    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;resetButton &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Button(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Reset"&lt;/SPAN&gt;);
    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;resetButton&lt;/SPAN&gt;.setMaxWidth( Double.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;MAX_VALUE &lt;/SPAN&gt;);
    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;resetButton&lt;/SPAN&gt;.setDisable( &lt;SPAN style="color: #000080; font-weight: bold;"&gt;true &lt;/SPAN&gt;);


    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;controlsVBox&lt;/SPAN&gt;.getChildren().addAll( directionsLabel, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;directionsList&lt;/SPAN&gt;, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;findButton&lt;/SPAN&gt;, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;resetButton &lt;/SPAN&gt;);
    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;MapView();
    setupMobileMap();
    setupGraphicsOverlay();

    System.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;out&lt;/SPAN&gt;.println( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"exit start" &lt;/SPAN&gt;);
}

&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;setupGraphicsOverlay()
{
    System.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;out&lt;/SPAN&gt;.println( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"SetupGraphicsOverlay Function" &lt;/SPAN&gt;);

    &lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView &lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;)
    {
        &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;routeGraphicsOverlay &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;GraphicsOverlay(  );
        &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView&lt;/SPAN&gt;.getGraphicsOverlays().add( &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;routeGraphicsOverlay &lt;/SPAN&gt;);

    }
}

&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;setupMobileMap()
{
    System.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;out&lt;/SPAN&gt;.println( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"SetupMobileMap Function" &lt;/SPAN&gt;);

    &lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView &lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;)
    {
        String mmpkFile = &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Greater_Los_Angeles.mmpk"&lt;/SPAN&gt;;
        &lt;SPAN style="color: #000080; font-weight: bold;"&gt;final &lt;/SPAN&gt;MobileMapPackage mapPackage = &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;MobileMapPackage( mmpkFile );
        mapPackage.loadAsync(); //this was below the listener but tired it here based on the SDK documentation (no change)
        mapPackage.addDoneLoadingListener( () -&amp;gt; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//it fails on the line below. I added the two output statements for debugging, so when those are
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//removed it fails on the if statement.
            System.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;out&lt;/SPAN&gt;.println( &lt;SPAN style="color: #660e7a;"&gt;mapPackage&lt;/SPAN&gt;.getLoadStatus() );&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;lt;---
            System.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;out&lt;/SPAN&gt;.println( &lt;SPAN style="color: #660e7a;"&gt;mapPackage&lt;/SPAN&gt;.getMaps().size() );
            &lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a;"&gt;mapPackage&lt;/SPAN&gt;.getLoadStatus() == LoadStatus.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;LOADED &lt;/SPAN&gt;&amp;amp;&amp;amp; &lt;SPAN style="color: #660e7a;"&gt;mapPackage&lt;/SPAN&gt;.getMaps().size() &amp;gt; &lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;)
            {
                &lt;SPAN style="color: #000080; font-weight: bold;"&gt;double &lt;/SPAN&gt;latitude = &lt;SPAN style="color: #0000ff;"&gt;34.05293&lt;/SPAN&gt;;
                &lt;SPAN style="color: #000080; font-weight: bold;"&gt;double &lt;/SPAN&gt;longitude = -&lt;SPAN style="color: #0000ff;"&gt;118.24368&lt;/SPAN&gt;;
                &lt;SPAN style="color: #000080; font-weight: bold;"&gt;double &lt;/SPAN&gt;scale = &lt;SPAN style="color: #0000ff;"&gt;220000&lt;/SPAN&gt;;

                ArcGISMap map = &lt;SPAN style="color: #660e7a;"&gt;mapPackage&lt;/SPAN&gt;.getMaps().get(&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;);
                &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;transportationNetwork &lt;/SPAN&gt;= map.getTransportationNetworks().get( &lt;SPAN style="color: #0000ff;"&gt;0 &lt;/SPAN&gt;);
                &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView&lt;/SPAN&gt;.setMap( map );
                map.setInitialViewpoint( &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Viewpoint( latitude,longitude,scale ) );
                &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;stackPane&lt;/SPAN&gt;.getChildren().addAll(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView&lt;/SPAN&gt;, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;controlsVBox&lt;/SPAN&gt;);
                StackPane.&lt;SPAN&gt;setAlignment&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;controlsVBox&lt;/SPAN&gt;, Pos.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;TOP_LEFT&lt;/SPAN&gt;);
                StackPane.&lt;SPAN&gt;setMargin&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;controlsVBox&lt;/SPAN&gt;, &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Insets(&lt;SPAN style="color: #0000ff;"&gt;10&lt;/SPAN&gt;, &lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;, &lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;, &lt;SPAN style="color: #0000ff;"&gt;10&lt;/SPAN&gt;));

                    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView&lt;/SPAN&gt;.addDrawStatusChangedListener( g -&amp;gt;
                    {
                        &lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(g.getDrawStatus() == DrawStatus.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;COMPLETED&lt;/SPAN&gt;)
                        {
                            &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;findButton&lt;/SPAN&gt;.setDisable( &lt;SPAN style="color: #000080; font-weight: bold;"&gt;false &lt;/SPAN&gt;);
                        }
                    });
                System.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;out&lt;/SPAN&gt;.println( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Calling setupRouteTask" &lt;/SPAN&gt;);
                setupRouteTask();
            } &lt;SPAN style="color: #000080; font-weight: bold;"&gt;else
&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;            &lt;/SPAN&gt;{
                &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Alert( Alert.AlertType.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;ERROR&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"MMPK failed to load: "
&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;                        &lt;/SPAN&gt;+ &lt;SPAN style="color: #660e7a;"&gt;mapPackage&lt;/SPAN&gt;.getLoadError().getMessage() ).show();
            }
        } );

    } &lt;SPAN style="color: #000080; font-weight: bold;"&gt;else
&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;    &lt;/SPAN&gt;{
        System.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;out&lt;/SPAN&gt;.println( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"MapView was Null" &lt;/SPAN&gt;);
    }
    System.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;out&lt;/SPAN&gt;.println( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Exit SetupMobileMap Function" &lt;/SPAN&gt;);
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 07:21:23 GMT</pubDate>
    <dc:creator>AlyssaAbram</dc:creator>
    <dc:date>2021-12-12T07:21:23Z</dc:date>
    <item>
      <title>Mobile Map Package mmpk File Loads Sometimes But Not Always</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/mobile-map-package-mmpk-file-loads-sometimes-but/m-p/735465#M2213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having an issue with loading an mmpk ( i think). Some times it will load, sometimes it will&amp;nbsp;fail, and sometimes it will hang. I haven't been able to figure out what is causing this as I can run the project a few times in a row and get different results, without changing any code between runs. I am very new to the java SDK and I'm trying to teach myself with the tutorials. I combined two tutorials, find route and get a route and directions offline, into one project to try to get turn by turn directions from an mmpk file. Both tutorials work fine on their own. Here's most of my code. When it actually loads, it mostly works (I'm still working on getting the find and reset buttons to work for point and click start and end points) I have notated what line is indicated by the error message.&lt;/P&gt;&lt;P&gt;When it fails/hangs the outputs I have included are:&lt;/P&gt;&lt;P&gt;Start Function&lt;BR /&gt;SetupMobileMap Function&lt;BR /&gt;Exit SetupMobileMap Function&lt;BR /&gt;SetupGraphicsOverlay Function&lt;BR /&gt;exit start&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error message is:&lt;/P&gt;&lt;P&gt;Exception in thread "JavaFX Application Thread" com.esri.arcgisruntime.ArcGISRuntimeException: Invalid argument: Null value.&lt;BR /&gt; at com.esri.arcgisruntime.internal.jni.CoreMobileMapPackage.nativeGetLoadStatus(Native Method)&lt;BR /&gt; at com.esri.arcgisruntime.internal.jni.CoreMobileMapPackage.getLoadStatus(CoreMobileMapPackage.java:142)&lt;BR /&gt; at com.esri.arcgisruntime.internal.loadable.LoadableImpl.getLoadStatus(LoadableImpl.java:125)&lt;BR /&gt; at com.esri.arcgisruntime.mapping.MobileMapPackage.getLoadStatus(MobileMapPackage.java:326)&lt;BR /&gt; at TurnByTurn.lambda$setupMobileMap$1(TurnByTurn.java:134)&lt;BR /&gt; at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)&lt;BR /&gt; at java.base/java.security.AccessController.doPrivileged(Native Method)&lt;BR /&gt; at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)&lt;BR /&gt; at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)&lt;BR /&gt; at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)&lt;BR /&gt; at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)&lt;BR /&gt; at java.base/java.lang.Thread.run(Thread.java:834)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When it loads the outputs are:&lt;/P&gt;&lt;P&gt;Start Function&lt;BR /&gt;SetupMobileMap Function&lt;BR /&gt;Exit SetupMobileMap Function&lt;BR /&gt;SetupGraphicsOverlay Function&lt;BR /&gt;exit start&lt;BR /&gt;LOADED&lt;BR /&gt;2&lt;BR /&gt;Calling setupRouteTask&lt;BR /&gt;SetupRouteTask Function&lt;BR /&gt;Licensed For Developer Use Only&lt;BR /&gt;CreateRouteAndDisplay Function&lt;BR /&gt;SolveForRoute Function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help with this would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;@Override
public void &lt;/SPAN&gt;start ( Stage stage )
{
    System.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;out&lt;/SPAN&gt;.println( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Start Function" &lt;/SPAN&gt;);

    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;stackPane &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;StackPane(  );
    Scene scene = &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Scene( &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;stackPane &lt;/SPAN&gt;);

    stage.setTitle( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Navigation" &lt;/SPAN&gt;);
    stage.setWidth( &lt;SPAN style="color: #0000ff;"&gt;800 &lt;/SPAN&gt;);
    stage.setHeight( &lt;SPAN style="color: #0000ff;"&gt;700 &lt;/SPAN&gt;);
    stage.show();
    stage.setScene( scene );


    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;controlsVBox &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;VBox(&lt;SPAN style="color: #0000ff;"&gt;6&lt;/SPAN&gt;);
    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;controlsVBox&lt;/SPAN&gt;.setBackground( &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Background( &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;BackgroundFill( Paint.&lt;SPAN&gt;valueOf&lt;/SPAN&gt;( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"rgba(0,0,0,0.3)" &lt;/SPAN&gt;),
            CornerRadii.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;EMPTY&lt;/SPAN&gt;, Insets.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;EMPTY &lt;/SPAN&gt;) ) );
    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;controlsVBox&lt;/SPAN&gt;.setPadding( &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Insets( &lt;SPAN style="color: #0000ff;"&gt;10.0 &lt;/SPAN&gt;) );
    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;controlsVBox&lt;/SPAN&gt;.setMaxSize( &lt;SPAN style="color: #0000ff;"&gt;400&lt;/SPAN&gt;,&lt;SPAN style="color: #0000ff;"&gt;300 &lt;/SPAN&gt;);
    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;controlsVBox&lt;/SPAN&gt;.getStyleClass().add( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"panel-region" &lt;/SPAN&gt;);

    Label directionsLabel = &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Label(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Route directions"&lt;/SPAN&gt;);
    directionsLabel.getStyleClass().add( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"panel-label" &lt;/SPAN&gt;);

    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;findButton &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Button(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Find Route"&lt;/SPAN&gt;);
    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;findButton&lt;/SPAN&gt;.setMaxWidth( Double.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;MAX_VALUE  &lt;/SPAN&gt;);
    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;findButton&lt;/SPAN&gt;.setDisable( &lt;SPAN style="color: #000080; font-weight: bold;"&gt;true &lt;/SPAN&gt;);

    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;resetButton &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Button(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Reset"&lt;/SPAN&gt;);
    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;resetButton&lt;/SPAN&gt;.setMaxWidth( Double.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;MAX_VALUE &lt;/SPAN&gt;);
    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;resetButton&lt;/SPAN&gt;.setDisable( &lt;SPAN style="color: #000080; font-weight: bold;"&gt;true &lt;/SPAN&gt;);


    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;controlsVBox&lt;/SPAN&gt;.getChildren().addAll( directionsLabel, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;directionsList&lt;/SPAN&gt;, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;findButton&lt;/SPAN&gt;, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;resetButton &lt;/SPAN&gt;);
    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;MapView();
    setupMobileMap();
    setupGraphicsOverlay();

    System.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;out&lt;/SPAN&gt;.println( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"exit start" &lt;/SPAN&gt;);
}

&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;setupGraphicsOverlay()
{
    System.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;out&lt;/SPAN&gt;.println( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"SetupGraphicsOverlay Function" &lt;/SPAN&gt;);

    &lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView &lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;)
    {
        &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;routeGraphicsOverlay &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;GraphicsOverlay(  );
        &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView&lt;/SPAN&gt;.getGraphicsOverlays().add( &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;routeGraphicsOverlay &lt;/SPAN&gt;);

    }
}

&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;setupMobileMap()
{
    System.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;out&lt;/SPAN&gt;.println( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"SetupMobileMap Function" &lt;/SPAN&gt;);

    &lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView &lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;)
    {
        String mmpkFile = &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Greater_Los_Angeles.mmpk"&lt;/SPAN&gt;;
        &lt;SPAN style="color: #000080; font-weight: bold;"&gt;final &lt;/SPAN&gt;MobileMapPackage mapPackage = &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;MobileMapPackage( mmpkFile );
        mapPackage.loadAsync(); //this was below the listener but tired it here based on the SDK documentation (no change)
        mapPackage.addDoneLoadingListener( () -&amp;gt; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//it fails on the line below. I added the two output statements for debugging, so when those are
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//removed it fails on the if statement.
            System.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;out&lt;/SPAN&gt;.println( &lt;SPAN style="color: #660e7a;"&gt;mapPackage&lt;/SPAN&gt;.getLoadStatus() );&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;lt;---
            System.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;out&lt;/SPAN&gt;.println( &lt;SPAN style="color: #660e7a;"&gt;mapPackage&lt;/SPAN&gt;.getMaps().size() );
            &lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a;"&gt;mapPackage&lt;/SPAN&gt;.getLoadStatus() == LoadStatus.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;LOADED &lt;/SPAN&gt;&amp;amp;&amp;amp; &lt;SPAN style="color: #660e7a;"&gt;mapPackage&lt;/SPAN&gt;.getMaps().size() &amp;gt; &lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;)
            {
                &lt;SPAN style="color: #000080; font-weight: bold;"&gt;double &lt;/SPAN&gt;latitude = &lt;SPAN style="color: #0000ff;"&gt;34.05293&lt;/SPAN&gt;;
                &lt;SPAN style="color: #000080; font-weight: bold;"&gt;double &lt;/SPAN&gt;longitude = -&lt;SPAN style="color: #0000ff;"&gt;118.24368&lt;/SPAN&gt;;
                &lt;SPAN style="color: #000080; font-weight: bold;"&gt;double &lt;/SPAN&gt;scale = &lt;SPAN style="color: #0000ff;"&gt;220000&lt;/SPAN&gt;;

                ArcGISMap map = &lt;SPAN style="color: #660e7a;"&gt;mapPackage&lt;/SPAN&gt;.getMaps().get(&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;);
                &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;transportationNetwork &lt;/SPAN&gt;= map.getTransportationNetworks().get( &lt;SPAN style="color: #0000ff;"&gt;0 &lt;/SPAN&gt;);
                &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView&lt;/SPAN&gt;.setMap( map );
                map.setInitialViewpoint( &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Viewpoint( latitude,longitude,scale ) );
                &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;stackPane&lt;/SPAN&gt;.getChildren().addAll(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView&lt;/SPAN&gt;, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;controlsVBox&lt;/SPAN&gt;);
                StackPane.&lt;SPAN&gt;setAlignment&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;controlsVBox&lt;/SPAN&gt;, Pos.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;TOP_LEFT&lt;/SPAN&gt;);
                StackPane.&lt;SPAN&gt;setMargin&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;controlsVBox&lt;/SPAN&gt;, &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Insets(&lt;SPAN style="color: #0000ff;"&gt;10&lt;/SPAN&gt;, &lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;, &lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;, &lt;SPAN style="color: #0000ff;"&gt;10&lt;/SPAN&gt;));

                    &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapView&lt;/SPAN&gt;.addDrawStatusChangedListener( g -&amp;gt;
                    {
                        &lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(g.getDrawStatus() == DrawStatus.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;COMPLETED&lt;/SPAN&gt;)
                        {
                            &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;findButton&lt;/SPAN&gt;.setDisable( &lt;SPAN style="color: #000080; font-weight: bold;"&gt;false &lt;/SPAN&gt;);
                        }
                    });
                System.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;out&lt;/SPAN&gt;.println( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Calling setupRouteTask" &lt;/SPAN&gt;);
                setupRouteTask();
            } &lt;SPAN style="color: #000080; font-weight: bold;"&gt;else
&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;            &lt;/SPAN&gt;{
                &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Alert( Alert.AlertType.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;ERROR&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"MMPK failed to load: "
&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;                        &lt;/SPAN&gt;+ &lt;SPAN style="color: #660e7a;"&gt;mapPackage&lt;/SPAN&gt;.getLoadError().getMessage() ).show();
            }
        } );

    } &lt;SPAN style="color: #000080; font-weight: bold;"&gt;else
&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;    &lt;/SPAN&gt;{
        System.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;out&lt;/SPAN&gt;.println( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"MapView was Null" &lt;/SPAN&gt;);
    }
    System.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;out&lt;/SPAN&gt;.println( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Exit SetupMobileMap Function" &lt;/SPAN&gt;);
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:21:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/mobile-map-package-mmpk-file-loads-sometimes-but/m-p/735465#M2213</guid>
      <dc:creator>AlyssaAbram</dc:creator>
      <dc:date>2021-12-12T07:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Mobile Map Package mmpk File Loads Sometimes But Not Always</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/mobile-map-package-mmpk-file-loads-sometimes-but/m-p/735466#M2214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alyssa,&lt;/P&gt;&lt;P&gt;I'm not sure but I wonder if the &lt;STRONG&gt;mapPackage&lt;/STRONG&gt; object might be garbage-collected before the done-loading listener is called, because it goes out of scope when &lt;STRONG&gt;setupMobileMap&lt;/STRONG&gt; returns. Try making it a member field to ensure it's not &lt;SPAN&gt;garbage-&lt;/SPAN&gt;collected.&lt;/P&gt;&lt;P&gt;Alan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2020 14:13:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/mobile-map-package-mmpk-file-loads-sometimes-but/m-p/735466#M2214</guid>
      <dc:creator>AlanLucas</dc:creator>
      <dc:date>2020-02-18T14:13:00Z</dc:date>
    </item>
  </channel>
</rss>

