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:
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.
This kind of “basemap shows on some devices but not others” issue with Flutter + ArcGIS usually boils down to one of a few culprits:
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:
<!-- 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>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.
hello Harish.
i allready use Https everywhere as it is an AGOL organisation.
i have tried the suggested error handling to check for load error, and i get no load error.
i have included a screenshot to show the problem as you can see the basemaps are loaded in the app they just show up as blanks with used in the app.
It work in newer versions.
if i need to add more information please just say what you need 🙂
best regards Rasmus