mapbox / mapbox/mapbox-navigation-android-examples
TutnByTurnExperienceActivity App crashes on startUp
还没有人认领这个 Issue。
- 主要语言
- Kotlin
- 星标
- 65
- 派生
- 56
- 平均合并
- 1 天 4 小时
- 30 天内合并 PR
- 2
描述
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)
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先在 TutnByTurnExperienceActivity 中复现启动过程,并通过堆栈跟踪追踪崩溃,从 BitmapUtils.kt 和 LocationIndicatorLayerRenderer.kt 开始。确认位置组件初始化不再以零尺寸调用 Bitmap.createBitmap,然后验证应用能够在不出现致命异常的情况下启动。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- android, kotlin
- 领域
- mobile
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100