You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for contributing to the Skip project! Please use this space to describe your change and add any labels (bug, enhancement, documentation, etc.) to help categorize your contribution.
REQUIRED: I have tested my change locally with swift test
OPTIONAL: I have tested my change on an iOS simulator or device
OPTIONAL: I have tested my change on an Android emulator or device
AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.
Root cause
LocationProvider.swift:226 called location.hasMslAltitude(), which transpiles to the Android Location.hasMslAltitude() method. That method (and getMslAltitudeMeters()) was only added in API 33 (Android 13 / TIRAMISU). On older devices the JVM finds no such method and throws NoSuchMethodError, crashing in LocationEvent..
The change
I guarded the MSL altitude access behind a runtime SDK check so it's only invoked on Android 13+:
LocationProvider.swift:226-231
// hasMslAltitude()/getMslAltitudeMeters() were added in API 33 (Android 13); calling them on older devices throws NoSuchMethodError
if android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.TIRAMISU, location.hasMslAltitude() {
self.altitude = location.getMslAltitudeMeters()
} else {
self.altitude = 0.0
}
On devices below API 33, altitude falls back to 0.0 (same fallback the original code used when MSL altitude was unset). The separate ellipsoidalAltitude field on the next line continues to populate from getAltitude(), which is available on all supported API levels.
This is the standard Skip pattern: the version constant resolves to android.os.Build.VERSION_CODES.TIRAMISU in the transpiled Kotlin, and the short-circuit && prevents hasMslAltitude() from ever being referenced on older runtimes.
No other hasMslAltitude/getMslAltitudeMeters usages exist in the source. The crash should be resolved on rebuild.
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
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.
…ibility
Thank you for contributing to the Skip project! Please use this space to describe your change and add any labels (bug, enhancement, documentation, etc.) to help categorize your contribution.
Please review the contribution guide at https://skip.dev/docs/contributing/ for advice and guidance on making high-quality PRs.
Skip Pull Request Checklist:
swift test