mapbox / mapbox/mapbox-navigation-android

[Android Auto] Fatal Exception: java.lang.IllegalStateException: When a deep link is found the geoDeeplinkPlacesProvider needs to be set

Open
#7,098 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
651
Forks
321
PR merge metrics
No merged PRs in 30d

Description

**Android API:**
33

**Mapbox Navigation SDK version:**
2.11.0
androidauto-v0.22.0

### Steps to trigger behavior
N/A

### Expected behavior
No crash

### Actual behavior
The app is crashing due to an `IllegalStateException` potentially because the `MapboxScreenManager` is not set up on time.

### Logs
```
Fatal Exception: java.lang.IllegalStateException: When a deep link is found the geoDeeplinkPlacesProvider needs to be set
at com.mapbox.androidauto.screenmanager.factories.GeoDeeplinkPlacesCarScreenFactory.create(GeoDeeplinkPlacesCarScreenFactory.java:36)
at com.mapbox.androidauto.screenmanager.MapboxScreenManager.onPush(MapboxScreenManager.java:45)
at com.mapbox.androidauto.screenmanager.MapboxScreenManager.onScreenEvent(MapboxScreenManager.java:34)
at com.mapbox.androidauto.screenmanager.MapboxScreenManager.access$onScreenEvent(MapboxScreenManager.java)
at com.mapbox.androidauto.screenmanager.MapboxScreenManager$lifecycleObserver$1$onCreate$1$invokeSuspend$$inlined$collect$1.emit(MapboxScreenManager.java:4)
at kotlinx.coroutines.flow.SharedFlowImpl.collect$suspendImpl(SharedFlowImpl.java:203)
at kotlinx.coroutines.flow.SharedFlowImpl.collect(SharedFlowImpl.java)
at kotlinx.coroutines.flow.ReadonlySharedFlow.collect(ReadonlySharedFlow.java:2)
at com.mapbox.androidauto.screenmanager.MapboxScreenManager$lifecycleObserver$1$onCreate$1.invokeSuspend(MapboxScreenManager.java:41)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(BaseContinuationImpl.java:11)
at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:132)
at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:16)
at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default(Cancellable.kt:5)
at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.java:41)
at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.java)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(BuildersKt__Builders_common.kt:22)
at kotlinx.coroutines.BuildersKt.launch(Builders.kt)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(BuildersKt__Builders_common.kt:12)
at kotlinx.coroutines.BuildersKt.launch$default(Builders.kt)
at com.mapbox.androidauto.screenmanager.MapboxScreenManager$lifecycleObserver$1.onCreate(MapboxScreenManager.java:42)
at androidx.lifecycle.FullLifecycleObserverAdapter.onStateChanged(FullLifecycleObserverAdapter.java:52)
at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:14)
at androidx.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.java:69)
at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:72)
at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:53)
at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.java:9)
at androidx.car.app.Session$LifecycleObserverImpl.onCreate(Session.java:6)
at androidx.lifecycle.FullLifecycleObserverAdapter.onStateChanged(FullLifecycleObserverAdapter.java:52)
at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:14)
at androidx.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.java:69)
at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:72)
at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:53)
at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.java:9)
at androidx.car.app.Session.handleLifecycleEvent(Session.java:2)
at androidx.car.app.CarAppBinder.lambda$onAppCreate$0(CarAppBinder.java:153)
at androidx.car.app.utils.RemoteUtils.lambda$dispatchCallFromHost$0(RemoteUtils.java)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8757)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with GeoDeeplinkPlacesCarScreenFactory.create at the logged failure, then trace MapboxScreenManager.onPush and onScreenEvent to understand how the deep-link screen is reached. Check when geoDeeplinkPlacesProvider and MapboxScreenManager are initialized relative to the lifecycle observer. Done means the reported Android Auto deep-link path no longer throws the IllegalStateException; the issue provides no test file or reproduction steps.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.