Problem creating folders on iOS device

08-10-2021 03:18 AM
New Contributor III


Im having troubles with the file structure of my app using the FileFolder qml type.

id: appFolder
path: app.folder.path

When i launch the app i execute the next method on the Component.OnCompleted event of the App:


That line returns a False


In other part of the app, i use the ZipReader to extract all the files that i get from my server, and that creates the folders without problem using the next line:

zipReader.extractAll(AppFramework.userHomeFolder.filePath("ArcGIS/AppStudio/Data/test/" + zippedIdSim));


I really dont know if i doing something wrong, but it strange that it works perfectly on Windows but on iOS can not create folders with the makePath method...

The main objective is to create individual folders inside that path.

└{some files}
└{some files}
└{some files}
└{some files}
└{some files}
└{some files}
└{some files}

The ones that comes with a Zip file works perfectly, but if i need to create the folder manually don't work at all.


A greeting!



Tags (3)
0 Kudos
1 Reply
New Contributor II

You're mixing concepts. `app.folder` refers to content, including QML that is makes your app. Whilst developing, you run your app in AppStudio and/or Player and this area is read-write. However, the issue here is when you build your app, `app.folder` will refer to a read-only compiled resource and become read-only. Therefore, `app.folder` is not a fit area to unpack your data.


The `AppFramework.userHomeFolder` refers to a cross platform representation of a "HOME" directory. For Linux and macOS, this does equate to the actual home folder. Similarly for Windows. However, for iOS and Android this refers to a sandboxed area within your app. It is okay, to use. However, in your usage, you try to append the two areas together.

I like to draw your attention to our shorthand "~" syntax which is a shortcut for your home folder, so you do not need to explicitly spell it out. The usage is like this:


FileFolder {

    id: workspace

    path: "~/ArcGIS/AppStudio/Data/test"


Then, to ensure that folder exists, you correctly identify that `makePath` needs to be called, i.e. `workspace.makePath()`,

I hope these pointers put you in the right direction. I haven't commented on your usage of ZIP, I think it's straightforward. But, if you need further assistance, let me know and we will troubleshoot further.

0 Kudos