mapbox / mapbox/mapbox-navigation-android-examples

TutnByTurnExperienceActivity App crashes on startUp

Open
#159 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

jira-sync-complete
Dominant language
Kotlin
Stars
65
Forks
56
Avg merge
1d 4h
Merged PRs (30d)
2

Description

2022-10-30 05:48:26.574 4553-4553/com.delaxesoft.smarttransportcity E/Mapbox: [nav-sdk]: [ViewportDataSourceProcessor] Provided following padding does not fit the map size:
mapSize: [width: 64.0, height: 64.0]
padding: [top: 360.0, left: 80.0, bottom: 300.0, right: 80.0]
Using an empty fallback padding instead: [top: 360.0, left: 80.0, bottom: 300.0, right: 80.0]
2022-10-30 05:48:26.607 4553-4553/com.delaxesoft.smarttransportcity E/Mapbox: [nav-sdk]: [ViewportDataSourceProcessor] Provided following padding does not fit the map size:
mapSize: [width: 64.0, height: 64.0]
padding: [top: 360.0, left: 80.0, bottom: 300.0, right: 80.0]
Using an empty fallback padding instead: [top: 360.0, left: 80.0, bottom: 300.0, right: 80.0]
2022-10-30 05:48:27.170 4553-4553/com.delaxesoft.smarttransportcity E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.delaxesoft.smarttransportcity, PID: 4553
java.lang.IllegalArgumentException: width and height must be > 0
at android.graphics.Bitmap.createBitmap(Bitmap.java:1042)
at android.graphics.Bitmap.createBitmap(Bitmap.java:1009)
at android.graphics.Bitmap.createBitmap(Bitmap.java:959)
at android.graphics.Bitmap.createBitmap(Bitmap.java:920)
at com.mapbox.maps.plugin.locationcomponent.utils.BitmapUtils.getBitmapFromDrawable(BitmapUtils.kt:31)
at com.mapbox.maps.plugin.locationcomponent.LocationIndicatorLayerRenderer.setupBitmaps(LocationIndicatorLayerRenderer.kt:80)
at com.mapbox.maps.plugin.locationcomponent.LocationIndicatorLayerRenderer.initializeComponents(LocationIndicatorLayerRenderer.kt:27)
at com.mapbox.maps.plugin.locationcomponent.LocationPuckManager.initialize(LocationPuckManager.kt:102)
at com.mapbox.maps.plugin.locationcomponent.LocationComponentPluginImpl$activateLocationComponent$1.invoke(LocationComponentPluginImpl.kt:207)
at com.mapbox.maps.plugin.locationcomponent.LocationComponentPluginImpl$activateLocationComponent$1.invoke(LocationComponentPluginImpl.kt:184)
at com.mapbox.maps.plugin.MapDelegateProviderImpl.getStyle$lambda-0(MapDelegateProviderImpl.kt:21)
at com.mapbox.maps.plugin.MapDelegateProviderImpl.$r8$lambda$prB63jRkHNgIjSUbBTljg7oBEc8(Unknown Source:0)
at com.mapbox.maps.plugin.MapDelegateProviderImpl$$ExternalSyntheticLambda0.onStyleLoaded(Unknown Source:2)
at com.mapbox.maps.StyleObserver.onStyleLoaded(StyleObserver.kt:96)
at com.mapbox.maps.NativeObserver.notify(NativeObserver.kt:63)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:330)
at android.os.Looper.loop(Looper.java:169)
at android.app.ActivityThread.main(ActivityThread.java:7143)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:876)

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 by reproducing startup in TutnByTurnExperienceActivity and follow the crash through the stack trace, beginning at BitmapUtils.kt and LocationIndicatorLayerRenderer.kt. Confirm the location component initialization no longer calls Bitmap.createBitmap with zero dimensions, then verify the app starts without the fatal exception.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.