I'm trying to create a new instance of SDKNativeEngine in this way
SDKOptions sdkOptions =
SDKOptions.withAccessKeySecretAndCachePathCacheSizeAndPersistentMapPath(
accessKeyId, accessKeySecret, externalPath, cacheSizeBytes, externalPath);
// Trying to use external map folder
await SDKNativeEngine.sharedInstance.internaldispose(() async {
SDKNativeEngine sdkNativeEngine;
try {
sdkNativeEngine = SDKNativeEngine(sdkOptions);
} on InstantiationException {
// Handle exception.
print('$InstantiationException');
}
SDKNativeEngine.sharedInstance = sdkNativeEngine;
isLoaded = true;
MapDownloadService mapDownloadService = ServiceProvider.of<MapDownloadService>();
await mapDownloadService?.fetchListRegions(forceRefresh: true);
});
Where the important thing for me is to set a custom path to save the map (externalPath variable), the value is /storage/<FB39-1114(SdCard)>/Android/data//files/MyMaps, but I'm getting this error
[ERROR] SDKNativeEngine - Failed to lock cache directory. Check the log above for more details. This usually happens when the second instance of SDKNativeEngine is created with the same access key id as the existing one (for example, shared instance). The issue might be fixed if SDKNativeEngine.dispose() method is called on existing instance before the creation of the new one. Keep in mind that the instance of SDKNativeEngine might exist in a separate process.
Also the map data is not saved in the custom path, it's always saved in the internal private storage