Repository navigation
fix(mobile,map-pipeline): fix Android release R8 MapLibre crash and offline region PMTiles downloads - #285
Merged
Conversation
Merged
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.
Summary
Resolves two root causes behind the missing map background and broken ~2-second offline region downloads on Android release builds:
Android Release R8 Obfuscation Crash (
PlatformViewsControllerNullPointerException):apps/mobile/android/app/proguard-rules.proand wired it intoapps/mobile/android/app/build.gradle.kts(buildTypes.release) to preserveio.flutter.plugin.platform.**,io.flutter.embedding.engine.plugins.**,io.flutter.plugin.common.**,com.github.josxha.maplibre.**,com.github.dart_lang.jni.**, andorg.maplibre.**.mapping.txtand on the physical Android tablet (KFQUWI/GCC1WE0421540ECA) thatMapLibreMapmounts with zeroPlatformException/NullPointerExceptionerrors.Offline Region Downloads & Self-Healing Validation:
_fallbackDownloadFromBundle()fromRegionManagerServiceso network/HTTP errors transition toDownloadStatus.failedinstead of silently copying the 499-byteglobal_overview.pmtilesstub intoregions/<id>/map.pmtilesand claiming a multi-MB download succeeded in ~2 seconds."PMTiles\x03") and minimum size (>= 4096bytes) validation inRegionManagerServiceandMapLibreMapService, plus automatic self-healing cleanup of previously written stub region directories.maxzoomon vector (primaryMaxZoom ?? 14) and terrain (terrainMaxZoom ?? 12) sources inMapLibreMapService.buildStyleJson()and clamped DEM zoom inElevationServiceso MapLibre Native overzooms regional PMTiles smoothly.Map Pipeline & GitHub Releases (
maps-v1) Hosting:tools/map-pipeline/generate_vector_tiles.py(--storage=mmap --force),generate_catalog.py,regions.yaml, andpublish_github_release.shto publish regional PMTiles andcatalog.jsontohttps://github.com/markusbrand/brandyfly/releases/tag/maps-v1.catalog.jsontomaps-v1, and updatedapps/mobile/assets/map_data/catalog.json.Verification
flutter test test/services/region_manager_service_test.dart test/services/maplibre_map_service_test.dart test/widgets/region_manager_ui_test.dart(19/19 passed)python3 tools/map-pipeline/test_pipeline.py(7/7 passed)npx openspec validate --all --strict(35/35 passed)KFQUWIAndroid tablet (GCC1WE0421540ECA): map background renders 3D hillshade + vector features, stub region directory self-healed on launch, and downloadingAlps - Eastern(66.6 MB) in Settings downloaded, verified SHA-256 checksums, and rendered offline vector & terrain tiles.