I’ve checked the permissions multiple times and tried calling it in so many different ways at different times in different screens, but it fails every time.
It seems to have permission however, according to the app permission info and after accepting the prompt.
Does anyone have an idea on a solution?
I’ve been cracking at this for days haha
To clarify, my goal is to create a folder in the home directory, then extract a downloaded zip file into the just created folder.
And here are the logs I’m getting, fetched from Android Studio:
When I try to create the folder Form DataDownload ErrorOccurred, errorNumber = 2108, componentType = File, functionName = MakeDirectory, messages = Cannot create directory at /storage/emulated/0/test
When I try to simply skip that process by manually creating the folder and just going straight to extracting: net.lingala.zip4j.exception.ZipException: Cannot create destination folder
1st check everything is working fine may b this happen due to your logic…
1st try to create an simple folder in ASD called App specific Directory use filescope as App directory and create an empty folder and check manually by Navigate to Android/data/pakjgname
with the help of your Device’s File manager …
if its working then manualy put an simple .zip file in that folder and try to extract that zip… of both procedure is working then its all about storage permission…
You do not have access to the root directory of the emulated sdcard anymore… use ASD as @Professional suggested or use shared shorage, i.e. for example /Download/test
Thank you both for the response
Just to clarify, I’m trying to create a folder in /storage/emulated/0/, is that the root directory you’re talking about?
My project depends on creating a directory there and unzipping that file, and I would’ve thought it was possible, even in Android 12…
The project installs an APK that literally relies on creating a folder in this directory, if I can’t do so, then this entire project has been for nothing haha. Just to clarify, the directory one level down from the Downloads folder to be absolutely clear, notAndroid > data / obb
And various applications such as ZArchiver, FileManager+ etc can all access this folder fine, so is this a restriction of Kodular?
To access the external storage, READ_ or WRITE_EXTERNAL_STORAGE permission is needed.
And I believe I have given my application these permissions via extensions.
And thank you both for the help, apologies if I’m coming across in a negative way
Well, this is not the root directory you were talking about previously, this is a subfolder of /Download what I suggested from the beginning of this thread
For example /Download/test
Or as full path /storage/emulated/0/Download/test
And I see now that it R/W_EXTERNAL_STORAGE is for older devices, so would I need to have MANAGE_EXTERNAL_STORAGE?
And I’ve read through the Android Filesystem thread, as well as the Android Developer page a few times, I hope this correlates with what I’m trying to do.
if your app targets Android 11 (API level 30) or higher, the WRITE_EXTERNAL_STORAGE permission doesn’t have any effect on your app’s access to storage.
Android 11 introduces the MANAGE_EXTERNAL_STORAGE permission, which provides write access to files outside the app-specific directory