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.
Point(
point.latitude,
point.longitude,
SpatialReference(MapConstants.EPSG_CODE)
)
Do I have to do sth special during the setup of the build.gradle so that the classes are avaiable during testing?
The exact error is:
Could not initialize class com.arcgismaps.internal.jni.CoreSpatialReference
java.lang.NoClassDefFoundError: Could not initialize class com.arcgismaps.internal.jni.CoreSpatialReference
at com.arcgismaps.geometry.SpatialReference.<init>(SpatialReference.kt:210)
at de.bwi.kvib.mobile.core.network.model.vorgang.FeatureVorgangRouteFormKt.toPolylines(FeatureVorgangRouteForm.kt:30)
Edit: When I create a point without a SpatialReference, I get the following error:
java.lang.NoClassDefFoundError: Could not initialize class com.arcgismaps.internal.jni.CorePoint
This shows that my setup seems to be incorrect but I followed the steps from here:
https://developers.arcgis.com/kotlin/install-and-set-up/
Edit 2: 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?
https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/can-t-unit-test-with-esri-s-android-runtime-sdk/td-p/213868