Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Custom style request fails when offline #16502

Open
thirstycoda opened this issue Jul 4, 2020 · 1 comment
Open

Custom style request fails when offline #16502

thirstycoda opened this issue Jul 4, 2020 · 1 comment

Comments

@thirstycoda
Copy link

thirstycoda commented Jul 4, 2020

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

@AAverin
Copy link

AAverin commented Oct 31, 2021

@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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants