mapbox / mapbox-navigation-android-examples

Other
53 stars 46 forks source link

[Android Auto] Updating ui-androidauto and adapting sample code #153

Closed narko closed 2 years ago

narko commented 2 years ago

Adding necessary changes for using ui-androidauto:0.12.0: https://github.com/mapbox/mapbox-navigation-android/releases/tag/androidauto-v0.12.0

narko commented 2 years ago

@kmadsen I wanted to try out the latest release with the samples and thought this might be useful sooner or later in this repo.

kmadsen commented 2 years ago

Pasting the issue that is surfaced (removed some PII). There is an incompatibility between nav-sdk 2.8 and 0.12.0, but this one was not expected

java.lang.NoSuchMethodError: No direct method <init>(Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V in class Lcom/mapbox/maps/plugin/LocationPuck2D; or its super classes (declaration of 'com.mapbox.maps.plugin.LocationPuck2D' appears in **Jz9C-Q==/base.apk!classes19.dex)
        at com.mapbox.androidauto.car.location.CarLocationPuck.navigationPuck2D(CarLocationPuck.kt:10)
        at com.mapbox.androidauto.car.location.CarLocationRenderer.onAttached(CarLocationRenderer.kt:23)
        at com.mapbox.maps.extension.androidauto.CarMapSurfaceOwner.registerObserver$extension_androidauto_release(CarMapSurfaceOwner.kt:54)
        at com.mapbox.maps.extension.androidauto.MapboxCarMap.registerObserver(MapboxCarMap.kt:139)
        at **.MapScreen.onResume(MapScreen.kt:40)
kmadsen commented 2 years ago

Updating dropin should fix any incompatibilities. But there is a different known issue https://github.com/mapbox/mapbox-navigation-android/releases/tag/v2.9.0-alpha.3

    implementation("com.mapbox.navigation:ui-dropin:2.9.0-alpha.3")
kmadsen commented 2 years ago

@narko why is this going into mapbox:main? There must be contributor rules here..

Screen Shot 2022-09-27 at 12 52 29 PM

Guardiola31337 commented 2 years ago

Hey @narko 👋 I've pulled in this commit in a new PR to get CI running #154

We should be good closing here and continue with any follow up work in #154 cc @kmadsen

Thanks so much for the contribution!

Guardiola31337 commented 2 years ago

Closing in favor of https://github.com/mapbox/mapbox-navigation-android-examples/pull/154

Thanks again for the contribution @narko 🙇‍♂️