Google Maps iOS SDK 2.7版GMSReverseGeocoder返回地址缺失问题反馈
Looks like you're hitting a recent service-side glitch with the Google Maps iOS SDK 2.7's GMSReverseGeocoder—over the last 48 hours, it's returning incomplete address lines for coordinates where it previously worked perfectly. For example:
GMSAddress { coordinate: (37.915000, 23.730000) lines: Alimos, Greece subLocality: Alimos locality: South Athens administrativeArea: Decentralized Administration of Attica country: Greece }
The lines field should normally deliver a fully formatted address, but right now it's only showing the sublocality and country. Here are some practical fixes and workarounds to get you back on track:
Roll back to a stable SDK version
This issue seems specific to v2.7. Try reverting to the previous stable release (like v2.6) to see if thelinesfield behaves as expected again. If you're using CocoaPods, update your Podfile:pod 'GoogleMaps', '~> 2.6'Then run
pod installto apply the change.Manually build the full address
Since all individual address components (subLocality, locality, administrativeArea, country) are still intact in theGMSAddressobject, you can construct your own formatted address instead of relying on the brokenlinesfield. Here's a Swift example:func formattedFullAddress(from address: GMSAddress) -> String { var components = [String]() if let subLocality = address.subLocality { components.append(subLocality) } if let locality = address.locality { components.append(locality) } if let adminArea = address.administrativeArea { components.append(adminArea) } if let country = address.country { components.append(country) } return components.joined(separator: ", ") }This will generate a full address string like "Alimos, South Athens, Decentralized Administration of Attica, Greece"—exactly what the
linesfield should return.Report the issue to Google
This is almost certainly a service-side problem (not a bug in the SDK code itself). Submit a detailed report to the Google Maps Platform Issue Tracker including:- The exact coordinates (37.915000, 23.730000)
- SDK version (2.7)
- Device and iOS version
- Screenshots or logs of the incomplete
GMSAddressresponse
The Google team will likely investigate and push a fix on their end quickly.
Use the Geocoding API directly
If you need the formatted address lines immediately, you can bypass the SDK'sGMSReverseGeocoderand make a direct HTTP request to the Google Geocoding API. Just ensure you have a valid API key and understand the billing implications. Parse the JSON response to extract theformatted_addressfield, which will give you the complete address.
内容的提问来源于stack exchange,提问作者Nikos M.

