<?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: NoClassDefFound for CoreSpatialReference in Unit Tests in Kotlin Maps SDK Questions</title>
    <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/noclassdeffound-for-corespatialreference-in-unit/m-p/1297474#M71</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/526455"&gt;@HudsonMiears&lt;/a&gt;, thanks for your reply, we put the test(s) into the androidTest folder and the jni error disappears. It would be great if such information was provided in the documentation.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 06:28:23 GMT</pubDate>
    <dc:creator>padmalcom</dc:creator>
    <dc:date>2023-06-09T06:28:23Z</dc:date>
    <item>
      <title>NoClassDefFound for CoreSpatialReference in Unit Tests</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/noclassdeffound-for-corespatialreference-in-unit/m-p/1296603#M67</link>
      <description>&lt;P&gt;Hi, we have several unit tests in our app (based on 200.1.0). When I create a point as shown below, I get a NoClassDefFound for CoreSpatialReference.&lt;/P&gt;&lt;PRE&gt;Point(&lt;BR /&gt;    point.&lt;SPAN&gt;latitude&lt;/SPAN&gt;,&lt;BR /&gt;    point.&lt;SPAN&gt;longitude&lt;/SPAN&gt;,&lt;BR /&gt;    SpatialReference(&lt;SPAN&gt;MapConstants&lt;/SPAN&gt;.&lt;SPAN&gt;EPSG_CODE&lt;/SPAN&gt;)&lt;BR /&gt;)&lt;/PRE&gt;&lt;P&gt;Do I have to do sth special during the setup of the build.gradle so that the classes are avaiable during testing?&lt;/P&gt;&lt;P&gt;The exact error is:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Could not initialize class com.arcgismaps.internal.jni.CoreSpatialReference&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;java.lang.NoClassDefFoundError: Could not initialize class com.arcgismaps.internal.jni.CoreSpatialReference&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;at com.arcgismaps.geometry.SpatialReference.&amp;lt;init&amp;gt;(SpatialReference.kt:210)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;at de.bwi.kvib.mobile.core.network.model.vorgang.FeatureVorgangRouteFormKt.toPolylines(FeatureVorgangRouteForm.kt:30)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Edit&lt;/STRONG&gt;: When I create a point without a SpatialReference, I get the following error:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;java.lang.NoClassDefFoundError: Could not initialize class com.arcgismaps.internal.jni.CorePoint&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This shows that my setup seems to be incorrect but I followed the steps from here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/kotlin/install-and-set-up/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/kotlin/install-and-set-up/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Edit 2&lt;/STRONG&gt;: Found a similar thread from two years ago. The solution proposes to do a ArcGISRuntime.initialize() but that class does not exist anymore. What is nowaday's equivalent?&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/can-t-unit-test-with-esri-s-android-runtime-sdk/td-p/213868" target="_blank"&gt;https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/can-t-unit-test-with-esri-s-android-runtime-sdk/td-p/213868&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 12:57:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/noclassdeffound-for-corespatialreference-in-unit/m-p/1296603#M67</guid>
      <dc:creator>padmalcom</dc:creator>
      <dc:date>2023-06-07T12:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: NoClassDefFound for CoreSpatialReference in Unit Tests</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/noclassdeffound-for-corespatialreference-in-unit/m-p/1297022#M70</link>
      <description>&lt;P&gt;Hi @padmalcon. Are you running these tests as non-instrumented tests? Unfortunately the SDK cannot be tested using non-instrumented tests, they must be put in the `androidTest` folder.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 09:05:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/noclassdeffound-for-corespatialreference-in-unit/m-p/1297022#M70</guid>
      <dc:creator>HudsonMiears</dc:creator>
      <dc:date>2023-06-08T09:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: NoClassDefFound for CoreSpatialReference in Unit Tests</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/noclassdeffound-for-corespatialreference-in-unit/m-p/1297474#M71</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/526455"&gt;@HudsonMiears&lt;/a&gt;, thanks for your reply, we put the test(s) into the androidTest folder and the jni error disappears. It would be great if such information was provided in the documentation.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 06:28:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/noclassdeffound-for-corespatialreference-in-unit/m-p/1297474#M71</guid>
      <dc:creator>padmalcom</dc:creator>
      <dc:date>2023-06-09T06:28:23Z</dc:date>
    </item>
  </channel>
</rss>

