<?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 com.esri.arcgisruntime.mapping.view.MapView.setMap Attempt to invoke virtual method on a null object reference in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/com-esri-arcgisruntime-mapping-view-mapview-setmap/m-p/1118767#M5652</link>
    <description>&lt;P&gt;I am attempting to execute thecode where the error occur Kotlin sample code for Find_Route and I get the following error at line 71 in the code:&amp;nbsp; &amp;nbsp; Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.esri.arcgisruntime.mapping.view.MapView.setMap(com.esri.arcgisruntime.mapping.ArcGISMap)' on a null object reference.&lt;/P&gt;&lt;P&gt;Here is the code where the error occurs:&lt;/P&gt;&lt;P&gt;&amp;lt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;// create a map with the basemap&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;val &lt;/SPAN&gt;map = ArcGISMap().&lt;SPAN&gt;apply &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;// set the basemap with the vector tiled layer from a service URL&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;basemap &lt;/SPAN&gt;= Basemap(&lt;BR /&gt;        ArcGISVectorTiledLayer(getString(R.string.&lt;SPAN&gt;navigation_vector&lt;/SPAN&gt;))&lt;BR /&gt;    )&lt;BR /&gt;&lt;SPAN&gt;}&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;mapView.&lt;SPAN&gt;apply &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;// set the map to be displayed in this view&lt;BR /&gt;&lt;/SPAN&gt;    &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;this.map = map   &amp;lt;&amp;lt;&amp;lt;&amp;lt;  Error occurs here...&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;    &lt;SPAN&gt;// set initial viewpoint to San Diego&lt;BR /&gt;&lt;/SPAN&gt;    setViewpoint(Viewpoint(&lt;SPAN&gt;32.7157&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;-&lt;SPAN&gt;117.1611&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;200000.0&lt;/SPAN&gt;))&lt;BR /&gt;    &lt;SPAN&gt;// ensure the floating action button moves to be above the attribution view&lt;BR /&gt;&lt;/SPAN&gt;    addAttributionViewLayoutChangeListener &lt;SPAN&gt;{ &lt;/SPAN&gt;_&lt;SPAN&gt;, &lt;/SPAN&gt;_&lt;SPAN&gt;, &lt;/SPAN&gt;_&lt;SPAN&gt;, &lt;/SPAN&gt;_&lt;SPAN&gt;, &lt;/SPAN&gt;bottom&lt;SPAN&gt;, &lt;/SPAN&gt;_&lt;SPAN&gt;, &lt;/SPAN&gt;_&lt;SPAN&gt;, &lt;/SPAN&gt;_&lt;SPAN&gt;, &lt;/SPAN&gt;oldBottom &lt;SPAN&gt;-&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;val &lt;/SPAN&gt;heightDelta = bottom - oldBottom&lt;BR /&gt;        (directionFab.&lt;SPAN&gt;layoutParams &lt;/SPAN&gt;&lt;SPAN&gt;as &lt;/SPAN&gt;ConstraintLayout.LayoutParams).&lt;SPAN&gt;bottomMargin &lt;/SPAN&gt;+= heightDelta&lt;BR /&gt;    &lt;SPAN&gt;}&lt;BR /&gt;&lt;/SPAN&gt;    mapView.&lt;SPAN&gt;graphicsOverlays&lt;/SPAN&gt;.add(&lt;SPAN&gt;graphicsOverlay&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;}/&amp;gt;&lt;BR /&gt;&lt;BR /&gt;Error occurs at highlighted code in red font. &lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Nov 2021 17:26:11 GMT</pubDate>
    <dc:creator>ScottBing2</dc:creator>
    <dc:date>2021-11-19T17:26:11Z</dc:date>
    <item>
      <title>com.esri.arcgisruntime.mapping.view.MapView.setMap Attempt to invoke virtual method on a null object reference</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/com-esri-arcgisruntime-mapping-view-mapview-setmap/m-p/1118767#M5652</link>
      <description>&lt;P&gt;I am attempting to execute thecode where the error occur Kotlin sample code for Find_Route and I get the following error at line 71 in the code:&amp;nbsp; &amp;nbsp; Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.esri.arcgisruntime.mapping.view.MapView.setMap(com.esri.arcgisruntime.mapping.ArcGISMap)' on a null object reference.&lt;/P&gt;&lt;P&gt;Here is the code where the error occurs:&lt;/P&gt;&lt;P&gt;&amp;lt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;// create a map with the basemap&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;val &lt;/SPAN&gt;map = ArcGISMap().&lt;SPAN&gt;apply &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;// set the basemap with the vector tiled layer from a service URL&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;basemap &lt;/SPAN&gt;= Basemap(&lt;BR /&gt;        ArcGISVectorTiledLayer(getString(R.string.&lt;SPAN&gt;navigation_vector&lt;/SPAN&gt;))&lt;BR /&gt;    )&lt;BR /&gt;&lt;SPAN&gt;}&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;mapView.&lt;SPAN&gt;apply &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;// set the map to be displayed in this view&lt;BR /&gt;&lt;/SPAN&gt;    &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;this.map = map   &amp;lt;&amp;lt;&amp;lt;&amp;lt;  Error occurs here...&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;    &lt;SPAN&gt;// set initial viewpoint to San Diego&lt;BR /&gt;&lt;/SPAN&gt;    setViewpoint(Viewpoint(&lt;SPAN&gt;32.7157&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;-&lt;SPAN&gt;117.1611&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;200000.0&lt;/SPAN&gt;))&lt;BR /&gt;    &lt;SPAN&gt;// ensure the floating action button moves to be above the attribution view&lt;BR /&gt;&lt;/SPAN&gt;    addAttributionViewLayoutChangeListener &lt;SPAN&gt;{ &lt;/SPAN&gt;_&lt;SPAN&gt;, &lt;/SPAN&gt;_&lt;SPAN&gt;, &lt;/SPAN&gt;_&lt;SPAN&gt;, &lt;/SPAN&gt;_&lt;SPAN&gt;, &lt;/SPAN&gt;bottom&lt;SPAN&gt;, &lt;/SPAN&gt;_&lt;SPAN&gt;, &lt;/SPAN&gt;_&lt;SPAN&gt;, &lt;/SPAN&gt;_&lt;SPAN&gt;, &lt;/SPAN&gt;oldBottom &lt;SPAN&gt;-&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;val &lt;/SPAN&gt;heightDelta = bottom - oldBottom&lt;BR /&gt;        (directionFab.&lt;SPAN&gt;layoutParams &lt;/SPAN&gt;&lt;SPAN&gt;as &lt;/SPAN&gt;ConstraintLayout.LayoutParams).&lt;SPAN&gt;bottomMargin &lt;/SPAN&gt;+= heightDelta&lt;BR /&gt;    &lt;SPAN&gt;}&lt;BR /&gt;&lt;/SPAN&gt;    mapView.&lt;SPAN&gt;graphicsOverlays&lt;/SPAN&gt;.add(&lt;SPAN&gt;graphicsOverlay&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;}/&amp;gt;&lt;BR /&gt;&lt;BR /&gt;Error occurs at highlighted code in red font. &lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 17:26:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/com-esri-arcgisruntime-mapping-view-mapview-setmap/m-p/1118767#M5652</guid>
      <dc:creator>ScottBing2</dc:creator>
      <dc:date>2021-11-19T17:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: com.esri.arcgisruntime.mapping.view.MapView.setMap Attempt to invoke virtual method on a null object reference</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/com-esri-arcgisruntime-mapping-view-mapview-setmap/m-p/1144491#M5681</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I would like to suggest you please use&amp;nbsp;&lt;BR /&gt;'mapView.map = map'&lt;/P&gt;&lt;P&gt;instead of&lt;/P&gt;&lt;P&gt;'this.map = map'.&lt;/P&gt;&lt;P&gt;I hope this will resolve you're the issue.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 04:37:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/com-esri-arcgisruntime-mapping-view-mapview-setmap/m-p/1144491#M5681</guid>
      <dc:creator>CodeDynode</dc:creator>
      <dc:date>2022-02-16T04:37:11Z</dc:date>
    </item>
  </channel>
</rss>

