mapbox / mapbox/mapbox-navigation-android

NullPointerException in NavigationNotificationProvider

Open
#3,734 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Device: Huawei Y5II
Android: 5.1

```
Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
at android.app.ApplicationPackageManager.getUserIfProfile(ApplicationPackageManager.java:1834)
at android.app.ApplicationPackageManager.getUserBadgeForDensity(ApplicationPackageManager.java:924)
at android.app.Notification$Builder.getProfileBadgeDrawable(Notification.java:2752)
at android.app.Notification$Builder.hasThreeLines(Notification.java:2983)
at android.app.Notification$Builder.build(Notification.java:3530)
at androidx.core.app.NotificationCompatBuilder.buildInternal(NotificationCompatBuilder.java:361)
at androidx.core.app.NotificationCompatBuilder.build(NotificationCompatBuilder.java:253)
at androidx.core.app.NotificationCompat$Builder.build(NotificationCompat.java:1677)
at com.mapbox.navigation.trip.notification.NavigationNotificationProvider.buildNotification(NavigationNotificationProvider.java:19)
at com.mapbox.navigation.trip.notification.internal.MapboxTripNotification.updateNotification(MapboxTripNotification.java:156)
at com.mapbox.navigation.core.trip.service.MapboxTripService.updateNotification(MapboxTripService.java:134)
at com.mapbox.navigation.core.trip.session.MapboxTripSession.updateRouteProgress(MapboxTripSession.java:515)
at com.mapbox.navigation.core.trip.session.MapboxTripSession.access$getLogger$p(MapboxTripSession.java:49)
at com.mapbox.navigation.core.trip.session.MapboxTripSession$updateDataFromNavigatorStatus$updateNavigatorStatusDataJob$1.invokeSuspend(MapboxTripSession.java:492)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(BaseContinuationImpl.java:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.java:106)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5931)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:987)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:782)
```

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 at com.mapbox.navigation.trip.notification.NavigationNotificationProvider.buildNotification, identified at line 19 in the stack trace, and trace its callers through MapboxTripNotification.updateNotification. Reproduce on the reported Huawei Y5II running Android 5.1 and determine why notification building reaches the platform NullPointerException; done when this crash no longer occurs and the relevant behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.