<?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 Re: NullPointerException: Attempt to invoke virtual method 'void com.esri.arcgisruntime.internal.jni.CoreDevice.b()' on a null object in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/nullpointerexception-attempt-to-invoke-virtual/m-p/1150391#M5699</link>
    <description>&lt;P&gt;I can reproduce the&amp;nbsp;CoreDevice.c() crash on 100.10.0&amp;nbsp;&lt;/P&gt;&lt;P&gt;CoreDevice.b() andCoreDevice.c() look like one is public and calls the other private function from the decompiled bytecode&lt;/P&gt;&lt;P&gt;I have noticed that I don't see the crash if I add a check to only dispose if current map has been loaded.&lt;/P&gt;&lt;P&gt;While this approach seems to work, can it cause any leaks during any specific circumstances if we don't call dispose ?&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/17660"&gt;@RamaChintapalli&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Calling dispose while in LOADING state seems to cause the crash.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;val &lt;/SPAN&gt;&lt;SPAN&gt;loadStatus &lt;/SPAN&gt;= &lt;SPAN&gt;mapView&lt;/SPAN&gt;.&lt;SPAN&gt;map&lt;/SPAN&gt;.&lt;SPAN&gt;loadStatus&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;if &lt;/SPAN&gt;(&lt;SPAN&gt;loadStatus &lt;/SPAN&gt;== &lt;SPAN&gt;LoadStatus&lt;/SPAN&gt;.&lt;SPAN&gt;LOADED&lt;/SPAN&gt;) {&lt;BR /&gt;&lt;SPAN&gt;    mapView&lt;/SPAN&gt;.dispose()&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;I also noticed I don't see the crash if just changing the ESRI Android API version to 100.13.0 in the sample app.&lt;/P&gt;&lt;P&gt;It looks like this issue was fixed. Does anyone have the bug # to confirm ?&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/17660"&gt;@RamaChintapalli&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Mar 2022 17:37:15 GMT</pubDate>
    <dc:creator>Dhruvin</dc:creator>
    <dc:date>2022-03-07T17:37:15Z</dc:date>
    <item>
      <title>NullPointerException: Attempt to invoke virtual method 'void com.esri.arcgisruntime.internal.jni.CoreDevice.b()' on a null object</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/nullpointerexception-attempt-to-invoke-virtual/m-p/1070873#M5541</link>
      <description>&lt;P&gt;I get this error on Crashlytics console, with no other information.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.esri.arcgisruntime.internal.jni.CoreDevice.b()' on a null object reference&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;at com.esri.arcgisruntime.mapping.view.GeoView$RenderingThread.run(SourceFile:13)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I don't know where it is happening. I have no more information&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I use kotlin and&amp;nbsp; &lt;SPAN&gt;com.esri.arcgisruntime:arcgis-android:100.11.0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;this error happens some times not all time&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 08:10:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/nullpointerexception-attempt-to-invoke-virtual/m-p/1070873#M5541</guid>
      <dc:creator>GeobuzonAplicaciones</dc:creator>
      <dc:date>2021-06-22T08:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: NullPointerException: Attempt to invoke virtual method 'void com.esri.arcgisruntime.internal.jni.CoreDevice.b()' on a null object</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/nullpointerexception-attempt-to-invoke-virtual/m-p/1076886#M5548</link>
      <description>&lt;P&gt;you should handle the null data inside the calls, you can add a try catch to handle the error.&lt;BR /&gt;if you can upload an extract of the code that produces the error.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 18:09:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/nullpointerexception-attempt-to-invoke-virtual/m-p/1076886#M5548</guid>
      <dc:creator>NicolasElgueta</dc:creator>
      <dc:date>2021-07-08T18:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: NullPointerException: Attempt to invoke virtual method 'void com.esri.arcgisruntime.internal.jni.CoreDevice.b()' on a null object</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/nullpointerexception-attempt-to-invoke-virtual/m-p/1076986#M5549</link>
      <description>&lt;P&gt;This reply and nothing are the same.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 20:58:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/nullpointerexception-attempt-to-invoke-virtual/m-p/1076986#M5549</guid>
      <dc:creator>GeobuzonAplicaciones</dc:creator>
      <dc:date>2021-07-08T20:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: NullPointerException: Attempt to invoke virtual method 'void com.esri.arcgisruntime.internal.jni.CoreDevice.b()' on a null object</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/nullpointerexception-attempt-to-invoke-virtual/m-p/1088280#M5585</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;We have seen this error reported from another source but with further debugging found that their app was incorrectly handling the orientation changes. In their case, the mapview was sent to&amp;nbsp;a background activity/fragment and it is being disposed even before instantiating the mapview.&lt;BR /&gt;&lt;BR /&gt;If you have any code that you can share, it can help us debug further you case. You can use one of our samples, try to repro your workflow and share with us.&lt;BR /&gt;&lt;A href="https://github.com/Esri/arcgis-runtime-samples-android" target="_blank" rel="noopener"&gt;https://github.com/Esri/arcgis-runtime-samples-android&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Rama&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 05:44:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/nullpointerexception-attempt-to-invoke-virtual/m-p/1088280#M5585</guid>
      <dc:creator>RamaChintapalli</dc:creator>
      <dc:date>2021-08-12T05:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: NullPointerException: Attempt to invoke virtual method 'void com.esri.arcgisruntime.internal.jni.CoreDevice.b()' on a null object</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/nullpointerexception-attempt-to-invoke-virtual/m-p/1091290#M5597</link>
      <description>&lt;P&gt;can you send the link to that case? (to see the code)&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 16:35:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/nullpointerexception-attempt-to-invoke-virtual/m-p/1091290#M5597</guid>
      <dc:creator>GeobuzonAplicaciones</dc:creator>
      <dc:date>2021-08-23T16:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: NullPointerException: Attempt to invoke virtual method 'void com.esri.arcgisruntime.internal.jni.CoreDevice.b()' on a null object</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/nullpointerexception-attempt-to-invoke-virtual/m-p/1096199#M5608</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/495135"&gt;@GeobuzonAplicaciones&lt;/a&gt;&amp;nbsp;and &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/17660"&gt;@RamaChintapalli&lt;/a&gt;&amp;nbsp;, I have a 100% case to reproduce this. I have a three tabs, ArcMap tab is at the end of these tabs and ArcMap is put together with other map. I have a switch button to turn on ArcMap visible or invisible. In this case, if I never switch it to ArcMap and ArcMap is never visible to users, then I call&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;mapSwitcherRootBinding&lt;/SPAN&gt;?.&lt;SPAN&gt;arcMapView&lt;/SPAN&gt;?.dispose()&lt;/PRE&gt;&lt;P&gt;inside&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;onDestroyView&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;it must crash and this exception is JNI crash and can't be caught in Kotlin side. I think that one possible solution is can we judge if it is rendered or not before dispose ?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 01:29:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/nullpointerexception-attempt-to-invoke-virtual/m-p/1096199#M5608</guid>
      <dc:creator>JarvanMo</dc:creator>
      <dc:date>2021-09-08T01:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: NullPointerException: Attempt to invoke virtual method 'void com.esri.arcgisruntime.internal.jni.CoreDevice.b()' on a null object</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/nullpointerexception-attempt-to-invoke-virtual/m-p/1150391#M5699</link>
      <description>&lt;P&gt;I can reproduce the&amp;nbsp;CoreDevice.c() crash on 100.10.0&amp;nbsp;&lt;/P&gt;&lt;P&gt;CoreDevice.b() andCoreDevice.c() look like one is public and calls the other private function from the decompiled bytecode&lt;/P&gt;&lt;P&gt;I have noticed that I don't see the crash if I add a check to only dispose if current map has been loaded.&lt;/P&gt;&lt;P&gt;While this approach seems to work, can it cause any leaks during any specific circumstances if we don't call dispose ?&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/17660"&gt;@RamaChintapalli&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Calling dispose while in LOADING state seems to cause the crash.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;val &lt;/SPAN&gt;&lt;SPAN&gt;loadStatus &lt;/SPAN&gt;= &lt;SPAN&gt;mapView&lt;/SPAN&gt;.&lt;SPAN&gt;map&lt;/SPAN&gt;.&lt;SPAN&gt;loadStatus&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;if &lt;/SPAN&gt;(&lt;SPAN&gt;loadStatus &lt;/SPAN&gt;== &lt;SPAN&gt;LoadStatus&lt;/SPAN&gt;.&lt;SPAN&gt;LOADED&lt;/SPAN&gt;) {&lt;BR /&gt;&lt;SPAN&gt;    mapView&lt;/SPAN&gt;.dispose()&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;I also noticed I don't see the crash if just changing the ESRI Android API version to 100.13.0 in the sample app.&lt;/P&gt;&lt;P&gt;It looks like this issue was fixed. Does anyone have the bug # to confirm ?&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/17660"&gt;@RamaChintapalli&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 17:37:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/nullpointerexception-attempt-to-invoke-virtual/m-p/1150391#M5699</guid>
      <dc:creator>Dhruvin</dc:creator>
      <dc:date>2022-03-07T17:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: NullPointerException: Attempt to invoke virtual method 'void com.esri.arcgisruntime.internal.jni.CoreDevice.b()' on a null object</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/nullpointerexception-attempt-to-invoke-virtual/m-p/1151380#M5701</link>
      <description>&lt;P&gt;HI Dhruvin,&lt;BR /&gt;Your approach to check the map status before disposing should work and not have any leaks. Again the idea is make sure dispose is not called before instantiating the map view.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can confirm that we made a fix part of another internal issue in 100.13 to safeguard the above null pointer exception being thrown in case app tries to dispose map view without instantiating it.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Rama&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 17:55:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/nullpointerexception-attempt-to-invoke-virtual/m-p/1151380#M5701</guid>
      <dc:creator>RamaChintapalli</dc:creator>
      <dc:date>2022-03-07T17:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: NullPointerException: Attempt to invoke virtual method 'void com.esri.arcgisruntime.internal.jni.CoreDevice.b()' on a null object</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/nullpointerexception-attempt-to-invoke-virtual/m-p/1151391#M5702</link>
      <description>&lt;P&gt;Thanks for the update&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/17660"&gt;@RamaChintapalli&lt;/a&gt;. This helps alot.&lt;/P&gt;&lt;P&gt;Did you have a bug # for the internal issue?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 18:08:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/nullpointerexception-attempt-to-invoke-virtual/m-p/1151391#M5702</guid>
      <dc:creator>Dhruvin</dc:creator>
      <dc:date>2022-03-07T18:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: NullPointerException: Attempt to invoke virtual method 'void com.esri.arcgisruntime.internal.jni.CoreDevice.b()' on a null object</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/nullpointerexception-attempt-to-invoke-virtual/m-p/1151393#M5703</link>
      <description>&lt;P&gt;Dhruvin,&lt;BR /&gt;It was done part of internal refactoring of the code. I don't have a public BUG# for it.&lt;BR /&gt;&lt;BR /&gt;I have a public BUG#:&amp;nbsp;BUG-000141674 for one of my above comments where the &lt;SPAN&gt;Fragment in the repro code is not handling the orientation changes appropriately and thereby causing same null pointer exception.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Rama&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 18:15:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/nullpointerexception-attempt-to-invoke-virtual/m-p/1151393#M5703</guid>
      <dc:creator>RamaChintapalli</dc:creator>
      <dc:date>2022-03-07T18:15:54Z</dc:date>
    </item>
  </channel>
</rss>

