mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.35k stars 1.33k forks source link

Custom style request fails when offline #16502

Open thirstycoda opened 4 years ago

thirstycoda commented 4 years ago

Platform: Android Mapbox SDK version:

I'm having an issue getting the mapbox sdk to use the custom maps that have been downloaded with the OfflineManager. The maps work fine online, but when putting the android emulator into airplane mode, the following error is logged:

I/Mbgl-HttpRequest: Request failed due to a connection error: Unable to resolve host "<hostname>": No address associated with hostname

My style url is in the format: https://<host>/<path>/<filename>.json?key=<access_token>

The MapView is configured as follows:

mapView.getMapAsync(map -> map.setStyle(styleUrl, onStyleLoaded));

I have browsed the sqlite database and the style exists as a resource and has the URL I would expect so I'm confident it matches the style url passed into the MapboxMap.setStyle function. I noticed the must_revalidate was set to 1 in the database but changing this to 0 made no difference.

Steps to trigger behavior

  1. Use the OfflineManager to create an offline region using a custom style with a URL in the format: https://<host>/<path>/<filename>.json?key=<access_token>
  2. Put the android emulator into airplane mode
  3. Open activity with a MapView configured as described above

Expected behavior

The offline region is shown

Actual behavior

The map view remains grey and errors appear in the log stating I/Mbgl-HttpRequest: Request failed due to a connection error: Unable to resolve host "<hostname>": No address associated with hostname

AAverin commented 2 years ago

@thirstycoda Could you please check if you also have this message in the logs when map doesnt load?

BUG IN CLIENT OF libsqlite3.dylib: database integrity compromised by API violation: vnode unlinked while in use: /private/var/mobile/Containers/Data/Application/E9F89FE6-3545-416A-A344-313E5A65A875/Library/Application Support/___/.mapbox/cache.db