esys-flutter-share
esys-flutter-share copied to clipboard
SecurityException: Permission Denial on share
I get this when I try to share an image
E/DatabaseUtils( 9486): java.lang.SecurityException: Permission Denial: reading de.esys.esysfluttershare.EsysFlutterShareFileProvider uri content://com.gorjan.airquality.fileprovider.github.com%2Forgs%2Fesysberlin%2Fesys-flutter-share/files/aircare.png from pid=8132, uid=1000 requires the provider be exported, or grantUriPermission()
E/DatabaseUtils( 9486): at android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:729)
E/DatabaseUtils( 9486): at android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:602)
E/DatabaseUtils( 9486): at android.content.ContentProvider$Transport.enforceFilePermission(ContentProvider.java:593)
E/DatabaseUtils( 9486): at android.content.ContentProvider$Transport.openTypedAssetFile(ContentProvider.java:507)
E/DatabaseUtils( 9486): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:307)
E/DatabaseUtils( 9486): at android.os.Binder.execTransactInternal(Binder.java:1021)
E/DatabaseUtils( 9486): at android.os.Binder.execTransact(Binder.java:994)
The sharing somehow succeeds still, but this expectation is printed in the console.
Can confirm this issue
same here. sharing does not work
same issue on Android 10 device, but does not occur on Android 9. Sharing does work nonetheless in both cases.
I am having same problem on android 10 devices. Any solution ?
I am having same problem. Any solution ?
Same on Android 10.
I have submitted a pull request . In the mean time you can use this in your pubspec.yaml
esys_flutter_share: git: url: git://github.com/jawad12345A/esys-flutter-share.git
I've the same issue, is this fixed?
I have submitted a pull request . In the mean time you can use this in your pubspec.yaml
esys_flutter_share: git: url: git://github.com/jawad12345A/esys-flutter-share.git
Use this
I have submitted a pull request . In the mean time you can use this in your pubspec.yaml esys_flutter_share: git: url: git://github.com/jawad12345A/esys-flutter-share.git
Use this
To share a file in Whatsapp for example from local app folder would be like this?
_recordedFile = File("$local/Sound-{$timerName}.wav");
var bytes = await _recordedFile.readAsBytes();
try {
await Share.file('File title', 'myfile.wav', bytes, 'audio/wav');
} catch (e) {
print('error: $e');
}
I think this is the solution https://github.com/MertcanDinler/Flutter-Advanced-Share/issues/2#issuecomment-445327215
especially this line
registrar.context().grantUriPermission(packageName, fileHelper.getUri(), Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);
Can you implement it?