braune-digital/nativescript-share-file

Doesn't work on Android 11

Closed this issue · 3 comments

When attempting to use this on Android 11, I get the following exception:

09-30 15:26:40.768  5770  5770 E Gmail   : ComposeActivity:Error adding attachment
09-30 15:26:40.768  5770  5770 E Gmail   : fzd: FileNotFoundException when openAssetFileDescriptor.
09-30 15:26:40.768  5770  5770 E Gmail   :  at fzc.a(SourceFile:7)
09-30 15:26:40.768  5770  5770 E Gmail   :  at fzc.a(SourceFile:41)
09-30 15:26:40.768  5770  5770 E Gmail   :  at dij.a(SourceFile:407)
09-30 15:26:40.768  5770  5770 E Gmail   :  at dlb.run(SourceFile:2)
09-30 15:26:40.768  5770  5770 E Gmail   :  at dij.onRequestPermissionsResult(SourceFile:20)
09-30 15:26:40.768  5770  5770 E Gmail   :  at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:8456)
09-30 15:26:40.768  5770  5770 E Gmail   :  at android.app.Activity.dispatchActivityResult(Activity.java:8304)
09-30 15:26:40.768  5770  5770 E Gmail   :  at android.app.ActivityThread.deliverResults(ActivityThread.java:4905)
09-30 15:26:40.768  5770  5770 E Gmail   :  at android.app.ActivityThread.handleSendResult(ActivityThread.java:4953)
09-30 15:26:40.768  5770  5770 E Gmail   :  at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
09-30 15:26:40.768  5770  5770 E Gmail   :  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
09-30 15:26:40.768  5770  5770 E Gmail   :  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
09-30 15:26:40.768  5770  5770 E Gmail   :  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2043)
09-30 15:26:40.768  5770  5770 E Gmail   :  at android.os.Handler.dispatchMessage(Handler.java:106)
09-30 15:26:40.768  5770  5770 E Gmail   :  at android.os.Looper.loop(Looper.java:216)
09-30 15:26:40.768  5770  5770 E Gmail   :  at android.app.ActivityThread.main(ActivityThread.java:7464)
09-30 15:26:40.768  5770  5770 E Gmail   :  at java.lang.reflect.Method.invoke(Native Method)
09-30 15:26:40.768  5770  5770 E Gmail   :  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
09-30 15:26:40.768  5770  5770 E Gmail   :  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:955)

It appears that Android 11 is more strict about file permissions, and is expecting us to use FileProvider instead.

Hey @interrobrian, is your PR backward compatible with android 9/10 also? Thanks

So what are we waiting for? PR is open for 2 month now.

Is the PR going to be merged? :)