Repository navigation
Fall back to OpenStreetMap when the build has no Google Maps key - #243
Merged
parawanderer merged 3 commits intoOct 13, 2026
Merged
Conversation
The map screen threw at start without MAPS_API_KEY; OSM needs no key, so it now stands in for Google in both the map and the history screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016xeHfDLMuUeusX9PEgNEmY
A debug build from CI without the repository secret gets maps_key_default_value, which the check did not recognise, so it still drew an empty Google map. The key decision is now a pure function with a JVM test, and MapsActivity's separate checkApiKey, which repeated it, is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Good change. Never had it outright crash myself for whatever reason from CI builds, likely because I just supplied an invalid key for the debug app instead of no key. Either way, the map would render as empty in that case which is annoying. Thanks for testing the no key path. Defaulting to OpenStreetMap is better in both cases (invalid key/no key). I'll have a model pass to add tests and also make the CI default to OpenStreetMap instead of a Google map that doesn't render. |
Owner
|
Pushed 8a49cad on top:
|
parawanderer
self-requested a review
October 13, 2026 09:21
parawanderer
had a problem deploying
to
Android Build
October 13, 2026 09:23 — with
GitHub Actions
Failure
effectiveProvider(null, key) was ambiguous between the two, and the unit test did not compile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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.
A build without
MAPS_API_KEYcrashes when the map screen opens (a fork, or a local build withoutsecrets.properties). CONTRIBUTING says the app builds without a key but the map will not load; in practice the app does not start.When the build has no Maps key and Google Maps is the chosen provider,
MapProviderFactory.effectiveProviderfalls back to OpenStreetMap, which needs no key. The map screen and the history screen both use it. Builds with a key behave exactly as before, and AMap is untouched.Verified: on a phone, a debug build without a key: the app starts and shows OSM on the map and in history.
./gradlew testAllandadd_strings.py --checkpass.