Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Intent android.content.Intent.setPackage(java.lang.String)' on a null object reference #107

Open
nbnD opened this issue May 31, 2024 · 0 comments

Comments

@nbnD
Copy link

nbnD commented May 31, 2024

Android version: Above v-10
Maplibre Navigation SDK version: 3.0.0

I am trying to start navigation, it was working fine before,. I have not updated maplibre or navigation versions.

  viewModel.directionsRoute.value.let { route ->
    if (route != null) {
        val options = NavigationLauncherOptions.builder()
            .directionsRoute(viewModel.directionsRoute.value)

            .shouldSimulateRoute(false)
            .initialMapCameraPosition(
                CameraPosition.Builder().target(viewModel.originLocation).zoom(14.0).build()
            )
            .waynameChipEnabled(false)
            .lightThemeResId(R.style.TestNavigationViewLight)
            .darkThemeResId(R.style.TestNavigationViewLight)
            .build()
        try{

        startNavigation(context as Activity, options)
        }catch (e:Exception){

        }
    }

I am doing this

but recently It is throwing the error

FATAL EXCEPTION: main Process: io.baato, PID: 9361 java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Intent android.content.Intent.setPackage(java.lang.String)' on a null object reference at com.mapbox.services.android.navigation.v5.navigation.MapboxNavigationNotification.createPendingOpenIntent(MapboxNavigationNotification.java:147) at com.mapbox.services.android.navigation.v5.navigation.MapboxNavigationNotification.buildNotification(MapboxNavigationNotification.java:126) at com.mapbox.services.android.navigation.v5.navigation.MapboxNavigationNotification.initialize(MapboxNavigationNotification.java:94) at com.mapbox.services.android.navigation.v5.navigation.MapboxNavigationNotification.<init>(MapboxNavigationNotification.java:64) at com.mapbox.services.android.navigation.v5.navigation.NavigationNotificationProvider.buildNotificationFrom(NavigationNotificationProvider.java:38) at com.mapbox.services.android.navigation.v5.navigation.NavigationNotificationProvider.<init>(NavigationNotificationProvider.java:14) at com.mapbox.services.android.navigation.v5.navigation.NavigationService.initializeNotificationProvider(NavigationService.java:99) at com.mapbox.services.android.navigation.v5.navigation.NavigationService.initialize(NavigationService.java:93) at com.mapbox.services.android.navigation.v5.navigation.NavigationService.startNavigation(NavigationService.java:67) at com.mapbox.services.android.navigation.v5.navigation.MapboxNavigation.onServiceConnected(MapboxNavigation.java:724) at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1956) at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1988) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:224) at android.app.ActivityThread.main(ActivityThread.java:7562) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant