[Share Content] Error "File exposed beyond app through ClipData.Item.getUri()" on Android 8

Forge Component
Published on 2018-03-06 by Pedro Marques
1 vote
Published on 2018-03-06 by Pedro Marques

When Sharing a PDF (via Url) on Android 8 (tested on Android 8.0 and Android 8.1), the application crashes with the error:

A fatal error has occurred. Please contact OutSystems support: file:///storage/emulated/0/Android/data/[APP NAME]/files/socialsharing-downloads/[FILE_NAME].pdf exposed beyond app through ClipData.Item.getUri()

This does not occur on devices with Andoid 6 or 7. Anyone with this problem? I saw this post in the "File Viewer Plugin" that may be related, quoting:

"Android N now no longer permit the use of file:/// uri to access local files.

The owner of this plugin will have to change Android cordova plugin source code in github before we can use this on Android N."

The url to my PDF is external, but as we can see by the error, the plugin stores the file localy and uses file://.

I would be very grateful if we can have a fix on this.


I have the same problem. Any conclusion?