mapbox-gl-native icon indicating copy to clipboard operation
mapbox-gl-native copied to clipboard

Custom style request fails when offline

Open thirstycoda opened this issue 5 years ago • 1 comments

Platform: Android Mapbox SDK version:

  • mapbox-android-sdk:9.2.0
  • mapbox-android-plugin-offline-v9:0.7.0

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

thirstycoda avatar Jul 04 '20 16:07 thirstycoda

@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

tonnyavery avatar Oct 31 '21 09:10 tonnyavery