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

Cannot load features tables from image layer, when temp directory cleaned #1200

Closed
smixik opened this issue Nov 14, 2022 · 1 comment
Closed
Labels

Comments

@smixik
Copy link

smixik commented Nov 14, 2022

Describe the Bug

if we clean application temporary directory it is impossible to load features

on loadTablesAndLayers function

there is a sqlite error 1014

Expected Behavior

recreate arcgis temporary directory if it not exists

Steps To Reproduce

before execute loadTablesAndLayers remove all subdirectories in application tmp directory

Reproducible Code

do {
            let tmpDirURL = FileManager.default.temporaryDirectory
            let tmpDirectory = try contentsOfDirectory(atPath: tmpDirURL.path)
            try tmpDirectory.forEach { file in
                let fileUrl = tmpDirURL.appendingPathComponent(file)
                try removeItem(atPath: fileUrl.path)
            }
        } catch {
            print("Failed to clear tmp folder")
        }

Additional Context

https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/load-tables-and-layers-problem-sqlite-cannot-open/m-p/1230901

@smixik smixik added the bug label Nov 14, 2022
@yo1995
Copy link
Collaborator

yo1995 commented Nov 15, 2022

Discussed in Esri Community (GeoNet), a better approach would be creating your own temp folder and clean it up once you've finished using it. An example:

@yo1995 yo1995 closed this as completed Nov 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants