Skip to content

chore: modernize navigation-sample and map-sample builds - #26

Merged
dkhawk merged 4 commits into
mainfrom
fix/add-utils-dep
Nov 9, 2026
Merged

dkhawk merged 4 commits into
mainfrom
fix/add-utils-dep

Conversation

@dkhawk

@dkhawk dkhawk commented Mar 12, 2026 •

Copy link
Copy Markdown
Contributor

Overview

This PR modernizes the build configuration and dependencies for both the navigation-sample and map-sample projects on top of Navigation SDK 8.0.0, AGP 9.2.0, Gradle 9.4.1, and compileSdk / targetSdk 37. It migrates the Groovy build scripts to Kotlin DSL, introduces Gradle Version Catalogs (gradle/libs.versions.toml), applies weekly dependency updates (superseding #29), integrates android-maps-utils 6.1.0, and migrates navigation-sample to Places SDK 6.0.2.

Changes Included

  • Kotlin DSL & Version Catalogs: Replaced all build.gradle and settings.gradle files with .gradle.kts scripts and centralized dependencies in gradle/libs.versions.toml across both map-sample and navigation-sample.
  • Java 17: Updated compile and Kotlin JVM targets to Java 17.
  • Dependency Updates (Superseding chore(deps): weekly minor and patch dependency updates #29):
    • com.google.android.libraries.navigation:navigation: 8.0.0
    • com.google.android.libraries.places:places: 4.0.0 → 6.0.2
    • com.google.maps.android:android-maps-utils: 6.1.0 (with com.google.android.gms:play-services-maps excluded to prevent duplicate class conflicts with Navigation SDK)
    • androidx.appcompat:appcompat: 1.7.1 → 1.8.0
    • androidx.constraintlayout:constraintlayout: 2.2.1 → 2.2.2
    • androidx.transition:transition: 1.7.0 → 1.7.2
    • com.google.auto.value:auto-value: 1.6.2 → 1.11.1
    • com.google.errorprone:error_prone_annotations: 2.11.0 → 2.51.0
    • joda-time:joda-time: 2.10.14 → 2.15.0
    • com.github.bumptech.glide:glide: 4.13.2 → 5.0.9
    • com.google.guava:guava: 31.0.1-android → 33.5.0-android
  • Places SDK v6.0.2 Migration:
    • Extracted Places SDK initialization into NavigationSampleApplication using Places.initializeWithNewPlacesApiEnabled(...).
    • Migrated PlacePickerActivity from the removed AutocompleteSupportFragment to PlaceAutocomplete.IntentBuilder() with ActivityResultContracts.StartActivityForResult() and FetchPlaceRequest (forwarding the session token and requesting ID, DISPLAY_NAME, LOCATION, and TYPES).
    • Updated NavFragmentActivity, NavViewActivity, and SwappingMapAndNavActivity from place.latLng to place.location.
  • Developer Experience & Docs: Added :app:installAndLaunch Gradle tasks and updated both README.md files to document secrets.properties API key configuration and Version Catalog usage.

@dkhawk
dkhawk requested a review from kshirsagarps March 12, 2026 00:11
@dkhawk
dkhawk requested a review from LoyalAbbas November 4, 2026 21:15
@LoyalAbbas

Copy link
Copy Markdown

Hi @dkhawk Nice cleanup overall! A few small things before merging:
let's remove BOB_DATA/ from .gitignore and drop Places API (New) from map-sample/README.md since map-sample doesn't use Places.
In NavigationSampleApplication and PlacePickerActivity, could we guard against a blank/missing MAPS_API_KEY to avoid a cold-start crash, log fetchPlace failures instead of failing silently, and switch getParcelableExtra to IntentCompat.getParcelableExtra (plus remove the leftover imports in SplashScreenActivity)?
Lastly, since AGP 9.2 has built-in Kotlin support, we can drop the unused kotlin-android plugin declaration and the no-op annotationProcessor entries in the Kotlin-only navigation-sample.

@dkhawk

dkhawk commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the review @LoyalAbbas! Addressed all of your feedback in 0f8f1a6 and d0f1d52:

  • Removed BOB_DATA/ from .gitignore
  • Dropped Places API (New) from map-sample/README.md Prerequisites
  • Guarded against a missing/blank/placeholder MAPS_API_KEY in NavigationSampleApplication and PlacePickerActivity (!Places.isInitialized()) to avoid cold-start crashes
  • Logged fetchPlace and PlaceAutocompleteActivity.RESULT_ERROR failures in PlacePickerActivity
  • Switched getParcelableExtra to IntentCompat.getParcelableExtra in PlacePickerActivity and removed the leftover imports in SplashScreenActivity
  • Removed the unused kotlin-android plugin declaration in map-sample and the no-op annotationProcessor entries in navigation-sample (note: kept alias(libs.plugins.kotlin.android) apply false 2.3.0 on the root navigation-sample/build.gradle.kts classpath so AGP 9.2.0's built-in Kotlin compiler uses kotlin-gradle-plugin:2.3.0 instead of AGP's bundled 2.2.10, which is needed to read the Kotlin 2.4.0 metadata in places:6.0.2 and android-maps-utils:6.1.0)

@dkhawk
dkhawk merged commit dba0f85 into main Nov 9, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants