mapbox / mapbox-maps-android

Interactive, thoroughly customizable maps in native Android powered by vector tiles and OpenGL.
https://www.mapbox.com/mobile-maps-sdk
Other
447 stars 128 forks source link

[Android Auto] Update googleCarAppLibrary version #2098

Open narko opened 1 year ago

narko commented 1 year ago

The module extension-androidauto uses googleCarAppLibrary version 1.2.0, which is the current stable version published by Google: https://developer.android.com/jetpack/androidx/releases/car-app

Google didn't publish a new stable version for a while and since extension-androidauto is currently in version 0.5.0, ideally Mapbox could allow the use of RC or alphas for the Google car library. This way, developers could benefit from the latest API changes (given the slow release cycle).

If this is not possible due to Mapbox's dev policies, it would be great to offer some snapshots using the latest Google car library dependency.

Doing so would facilitate the work with com.mapbox.navigation:ui-androidauto in car related projects.

@Zayankovsky @kmadsen

pengdev commented 1 year ago

ideally Mapbox could allow the use of RC or alphas for the Google car library.

Thanks for the feedback @narko, the googleCarAppLibrary is a transitive dependency of the extension-androidauto, it's possible that you overwrite this dependency in your application by specifically add a newer version of the library:

    implementation("androidx.car.app:app:1.3.0-rc01")

This way you can use it together with the newer google car app library version.

narko commented 1 year ago

Thanks @pengdev.

it's possible that you overwrite this dependency in your application by specifically add a newer version of the library

I do that already, however gradle is still pulling 1.2.0. If you do so, you'll see that Android Studio shows a conflict in the gradle dependency analyzer. image

One more thing to remark is that changes introduced in newer versions of the googleCarAppLibrary might not have been adjusted in extension-androidauto. For example the handling of onClick (onTap) gestures.

Not sure if I am missing something, but I think we need more than just importing a different version in gradle.

pengdev commented 1 year ago

We have an example branch showcasing how to use it with androidx.car.app:app:1.3.0-beta01 with the onClick handling. Also I think if Car App Library follows semantic versioning, it should be backward compatible with the android auto extension. Please let us know if there are specific issues you come across during the integration.

narko commented 1 year ago

Thanks @pengdev and sorry for the delay answering. The onClick support works with that approach by @kmadsen.

I wonder if the original suggestion of using newer Car App Library versions would be possible for you guys?