Hello Everybody,
i'am struggeling arround with Preplanned offline Maps and need some help.
The Problem:
offlinemaptask.getPreplannedMapAreasAsync returns a Empty UnmodifiableList.
What i have Done before:
- I have created a new Map in the Arcgis Gallery (I tried OSM and Street as Basemaps) and
- Added a Offline Map Rectangle to the Map

- Added the Permission to the API Key to use this Item

Environment/License:
I used the Free Developer Tier. I Have also in the same app the MapView and it worked - So Credentials and API Key is Ok.
Code Snippet:
ArcGISRuntimeEnvironment.setInstallDirectory(arcgisInstallFolder);
ArcGISRuntimeEnvironment.setApiKey(arcgisApiKey);
AuthenticationManager.setAuthenticationChallengeHandler(new DefaultAuthenticationChallengeHandler());
Credential cred = new UserCredential("username", "password");
portal = new Portal("https://www.arcgis.com/");
portal.setCredential(cred);
portalItem = new PortalItem(portal, "2098a0d8b#Cleaned#74b67bf3");
OfflineMapTask offlineMapTask = new OfflineMapTask(portalItem);
ListenableFuture<List<PreplannedMapArea>> future = offlineMapTask.getPreplannedMapAreasAsync();
future.addDoneListener(() -> {
try {
List<PreplannedMapArea> preplannedMaps = future.get(); // <---- preplannedMaps is EMPTY :-((((
} catch (InterruptedException | ExecutionException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
} );
The Question:
What can be the Reason why the Preplanned Maps are empty ?