Repository navigation
fix(tutorials): migrate CurrentPlaceDetailsOnMap to Places SDK 6 - #2456
Merged
Merged
Conversation
Places SDK for Android 6.0 removed Places.initialize and PlacesClient.findCurrentPlace, which both CurrentPlaceDetailsOnMap tutorials relied on. Use Places.initializeWithNewPlacesApiEnabled and searchNearby around the device's last-known location instead. The tutorials were not part of the root build, so the breakage went unnoticed. Include them in settings.gradle.kts, the build-tutorials CI job and verify_all.sh, and fix the build files so they compile with the shared version catalog and current AGP.
kikoso
marked this pull request as ready for review
October 15, 2026 16:01
dkhawk
reviewed
Oct 15, 2026
| } | ||
| } | ||
| // Build a list of likely places to show the user. | ||
| likelyPlaceNames = likelyPlaces.map { it.displayName }.toTypedArray() |
Contributor
There was a problem hiding this comment.
THB, I have never liked this way of handling the results. These should be data classes that group the fields into an object. WDYT?
dkhawk
approved these changes
Oct 15, 2026
dkhawk
left a comment
Contributor
There was a problem hiding this comment.
This is a good update. Left one comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Places SDK for Android 6.0 (bumped in #2455) removed
Places.initializeandPlacesClient.findCurrentPlace. BothCurrentPlaceDetailsOnMaptutorials (Java and Kotlin) used them. The tutorials weren't part of the root build, so CI never caught it.Code (Java and Kotlin, kept in parity)
Places.initialize→Places.initializeWithNewPlacesApiEnabled.findCurrentPlace→searchNearbyover a 100 mCircularBoundsaround the device's last-known location, ranked by distance, limited to 5 results. Falls back to the map's camera target if no location is available yet.NAME/ADDRESS/LAT_LNG→DISPLAY_NAME/FORMATTED_ADDRESS/LOCATION(the old ones no longer exist in 6.0.2).MAPS_API_KEYlike the Kotlin version. The root build doesn't definePLACES_API_KEY.Region tags are unchanged. The published
maps_current_place_show_current_placeexcerpt changes content, which is the point of this PR. The Current Place tutorial text that describesfindCurrentPlacewill need a matching docs update.Build
settings.gradle.kts, thebuild-tutorialsCI job andscripts/verify_all.sh, the same wayPolygonsis.playServicesMaps,coreKtx,espressoCore,kotlinBom,lifecycleViewModelKtx).proguard-android.txt→proguard-android-optimize.txt(current AGP rejects the former).play-services-locationexplicitly. The tutorials useFusedLocationProviderClientbut relied on getting it transitively.Testing
:tutorials:{java,kotlin}:CurrentPlaceDetailsOnMap:assembleDebugandlintDebugpass.:tutorials:kotlin:Polygons:assembleDebugandspotlessCheckpass.