Dependencies :
implementation(platform("com.esri:arcgis-maps-kotlin-toolkit-bom:200.5.0"))
implementation("com.esri:arcgis-maps-kotlin-toolkit-geoview-compose")
I am using Compose MapView to display list of map using lazy column
App is crashing when user clicks on MapView just when it is InProgress draw state.
Below is my code :
MapView(
modifier = modifier.fillMaxSize(),
arcGISMap = map,
mapViewProxy = mapViewProxy,
graphicsOverlays = graphicsOverlays,
mapViewInteractionOptions = MapViewInteractionOptions(
isEnabled = false,
isMagnifierEnabled = false,
isZoomEnabled = false,
isRotateEnabled = false,
isFlingEnabled = false,
allowMagnifierToPan = false,
isPanEnabled = false
),
isAttributionBarVisible = false,
insets = insertPaddingValues,
viewpointPersistence = ViewpointPersistence.None,
onSingleTapConfirmed = { onTap() },
onDrawStatusChanged = {
if (it == DrawStatus.Completed) {
coroutineScope.launch {
mapViewProxy.exportImage().onSuccess { image ->
// export map image
}
}
}
}
)
Below is the error log :
10:13:42.211 E FATAL EXCEPTION: main
Process: za.co.tracker.consumer, PID: 29653
java.lang.NullPointerException: A null pointer.
at com.arcgismaps.internal.ErrorFactoryKt.toPlatformExceptionOrNull(ErrorFactory.kt:202)
at com.arcgismaps.internal.ErrorFactoryKt.convertToPublic(ErrorFactory.kt:111)
at com.arcgismaps.internal.ErrorFactory.createThrowableFromCoreError(ErrorFactory.kt:59)
at com.arcgismaps.internal.jni.CoreGeoView.nativeGeometryEditorInteractionTap(Native Method)
at com.arcgismaps.internal.jni.CoreGeoView.geometryEditorInteractionTap(CoreGeoView.java:403)
at com.arcgismaps.mapping.view.GeoView.geometryEditorTap$arcgis_maps_kotlin_release(GeoView.kt:1250)
at com.arcgismaps.mapping.view.internal.DefaultMapViewOnTouchListener.onRecognizerSingleTapConfirmed(DefaultMapViewOnTouchListener.kt:317)
at com.arcgismaps.mapping.view.internal.DefaultMapViewOnTouchListener.access$onRecognizerSingleTapConfirmed(DefaultMapViewOnTouchListener.kt:83)
at com.arcgismaps.mapping.view.internal.DefaultMapViewOnTouchListener$onLifecycleReady$$inlined$launchAndCollectInMapViewResumed$2$1$1.emit(FlowExtensions.kt:51)
at kotlinx.coroutines.flow.SharedFlowImpl.collect$suspendImpl(SharedFlow.kt:392)
at kotlinx.coroutines.flow.SharedFlowImpl$collect$1.invokeSuspend(Unknown Source:19)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:231)
at kotlinx.coroutines.DispatchedTaskKt.resumeUnconfined(DispatchedTask.kt:187)
at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:159)
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:470)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:504)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:493)
at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:364)
at kotlinx.coroutines.flow.SharedFlowImpl.tryEmit(SharedFlow.kt:409)
at com.arcgismaps.mapping.view.internal.SingleTapConfirmedGestureRecognizer.emitSingleTapConfirmed(SingleTapConfirmedGestureRecognizer.kt:169)
at com.arcgismaps.mapping.view.internal.SingleTapConfirmedGestureRecognizer.access$emitSingleTapConfirmed(SingleTapConfirmedGestureRecognizer.kt:47)
at com.arcgismaps.mapping.view.internal.SingleTapConfirmedGestureRecognizer$onTouch$2.invokeSuspend(SingleTapConfirmedGestureRecognizer.kt:141)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:231)
at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:164)
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:470)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:504)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:493)
at kotlinx.coroutines.CancellableContinuationImpl.resumeUndispatched(CancellableContinuationImpl.kt:591)
at kotlinx.coroutines.android.HandlerContext$scheduleResumeAfterDelay$$inlined$Runnable$1.run(Runnable.kt:15)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:240)
at android.os.Looper.loop(Looper.java:351)
at android.app.ActivityThread.main(ActivityThread.java:8423)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@5210a97, Dispatchers.Main.immediate]
Caused by: com.arcgismaps.exceptions.ArcGISExceptionImpl: message=A null pointer., additionalMessage=object cannot be null., errorCode=1
10:13:42.211 E at com.arcgismaps.exceptions.ArcGISException$Companion.create$arcgis_maps_kotlin_release(ArcGISException.kt:86)
at com.arcgismaps.internal.ErrorFactoryKt.convertToPublic(ErrorFactory.kt:128)
... 37 more