[File Plugin] [File Plugin] Not working on Android 10 a.k.a Android Q

Forge Component
(7)
Published on 2018-10-16 by Pedro Oliveira
7 votes
Published on 2018-10-16 by Pedro Oliveira

I've some issues with file plugin in my application. I can’t save files using file plugin and this issue happens when the application running on android 10. Please recheck this issue, because it’s only happened in a newer version of android (Android Q a.ka. 10) and run normally in android 9.


When I'm trying to check this issue, I found in android 10 not given any permission to read or write in storage. I already try to add android plugin permission for write access but not solving this issue. In our opinion, this issue is about permissions but I can’t solve with our solution and I hope this post can help me to find a way out to fix this issue.


*Note: when debugging action flow, I saw err code 12 and 9, and I don't know why this error code just shows when I'm using Android 10

Hi, 

With what version of MABS did you compile your application?

Bas de Jong wrote:

Hi, 

With what version of MABS did you compile your application?

Compile with MABS 6.1 in outsystems 10


I'm also having issues with downloading xlsx files on Android version 10 using MABS 6.2. 

On the SaveFile action if I pass anything different than the value cordova.file.externalDataDirectory returns as the Path it throws an error "cannot read getDirectory of null". If I leave empty the action simply runs without throwing any issues.

Just to eliminate the option I also implemented the permissions request to allow to write to external storage but I'm downloading an xlsx file and it doesn't require any permissions to download these type of files. But still does not work.

Any help will be greatly appreciated.

Thanks

I might have figured it out. The SaveFile action seems to be working fine, meanwhile, if the user does not have an app installed to view the specific type of file, nothing happens.

I tried with a PDF file and it works flawlessly, but, since I did not have an app to open .xlsx files installed/enabled on my mobile phone, nothing would happen.

I am using the File Viewer Plugin to view the file. 

Is there an option to download the file to the phone in this case? I taught SaveFile would do this, but apparently no.

Mario Andrade wrote:

I might have figured it out. The SaveFile action seems to be working fine, meanwhile, if the user does not have an app installed to view the specific type of file, nothing happens.

I tried with a PDF file and it works flawlessly, but, since I did not have an app to open .xlsx files installed/enabled on my mobile phone, nothing would happen.

I am using the File Viewer Plugin to view the file. 

Is there an option to download the file to the phone in this case? I taught SaveFile would do this, but apparently no.

 

Hi there!
I've the same problem downloading an image.

I was trying to download to the native documents or download folder at Android 8 and Android 10 as well. External write permissions given. 

Did you manage to save file where you specified without the File Viewer Plugin?