Select to view content in your preferred language

background maps not showing on older android systems.

98
1
Thursday
Labels (1)
RasmusLind
New Contributor

as the subject suggests i have a problem on the app i have made with the backgroundmaps not showing on older models. The background maps comes from a group on an agol organisation https://danmarksdata.maps.arcgis.com/home/group.html?sortField=modified&sortOrder=desc&id=1a2896d741.... i use http calls to the rest api to find the items in the group and then uses: 

Basemap.withItem(basemapitem.results[0]);
to make the Basemap object.

the newest version of android where is fails has been android 13 api 33-ext5.

has any one else experienced something like this and has a solution to this. 

0 Kudos
1 Reply
HarishK
Esri Contributor

This kind of “basemap shows on some devices but not others” issue with Flutter + ArcGIS usually boils down to one of a few culprits:

  • cleartext/HTTP being blocked on newer Android
  • item accessibility/auth
  • load error coming from a specific basemap/layer (e.g., vector tile style referencing blocked resources)

Quick things to verify first

1. Are you using http anywhere? 

On Android 9+ (API 28+), cleartext (http) is blocked by default. If you call the REST API over http or if the basemap’s service URL is `http`, Android 13 will refuse to load it.

Fix: Use https everywhere for:

  • REST item searches
  • Service URLs inside the Portal Items (item data can reference layers that are http even if the item page is https).
  • Temporary debug workaround (not recommended for prod):
<!-- AndroidManifest.xml -->
        <application
            android:usesCleartextTraffic="true"
            android:networkSecurityConfig="@xml/network_security_config" .../>

 

<!-- res/xml/network_security_config.xml -->
        <network-security-config>
          <base-config cleartextTrafficPermitted="true" />
        </network-security-config>
  • If this makes basemaps appear, you’ve confirmed a cleartext/HTTP issue. Switch to HTTPS URLs in items and remove this config for production.

2. Check the actual load error:

Wrap loads in try/catch and print loadError.message and loadError.additionalInfo. With the ArcGIS Flutter plugin (which wraps the native SDK), you can do:

final item = PortalItem.withPortalAndItemId(portal: dataMarksPortal , itemId: dataMarksBasemapId);
    await item.load();
    if (item.loadStatus != LoadStatus.loaded) {
      print('PortalItem failed: ${item.loadError?.message}');
    }

    final basemap = Basemap.withItem(item);
    await basemap.load();
    if (basemap.loadStatus != LoadStatus.loaded) {
      print('Basemap failed: ${basemap.loadError?.message}');
    }

 

You’ll often see something explicit like “CLEARTEXT not permitted”, “401/403”, or a TLS/certificate error.


0 Kudos