KasemJaffer / receive_sharing_intent

A Flutter plugin that enables flutter apps to receive sharing photos, text and url from other apps.
Apache License 2.0
334 stars 395 forks source link

Error When Sharing File from Google Drive Application #305

Open martinogarrizzo5 opened 5 months ago

martinogarrizzo5 commented 5 months ago

Hi, I’ve been using this library in multiple projects, and it has always performed well. However, during recent testing, I encountered an issue when sharing a file from the Google Drive application. This is the message that appears in the debug console:

I/FileDirectory(28362): File name: 26/05/2024 workout.pdf
D/AndroidRuntime(28362): Shutting down VM
E/AndroidRuntime(28362): FATAL EXCEPTION: main
E/AndroidRuntime(28362): Process: it.assocaaf.app, PID: 28362
E/AndroidRuntime(28362): java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
E/AndroidRuntime(28362):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:562)
E/AndroidRuntime(28362):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
E/AndroidRuntime(28362): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime(28362):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(28362):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
E/AndroidRuntime(28362):    ... 1 more
E/AndroidRuntime(28362): Caused by: java.io.FileNotFoundException: /data/user/0/it.assocaaf.app/cache/26/05/2024 workout.pdf: open failed: ENOENT (No such file or directory)
E/AndroidRuntime(28362):    at libcore.io.IoBridge.open(IoBridge.java:574)
E/AndroidRuntime(28362):    at java.io.FileOutputStream.<init>(FileOutputStream.java:236)
E/AndroidRuntime(28362):    at java.io.FileOutputStream.<init>(FileOutputStream.java:186)
E/AndroidRuntime(28362):    at com.kasem.receive_sharing_intent.FileDirectory.getDataColumn(FileDirectory.kt:124)
E/AndroidRuntime(28362):    at com.kasem.receive_sharing_intent.FileDirectory.getAbsolutePath(FileDirectory.kt:74)
E/AndroidRuntime(28362):    at com.kasem.receive_sharing_intent.ReceiveSharingIntentPlugin.toJsonObject(ReceiveSharingIntentPlugin.kt:141)
E/AndroidRuntime(28362):    at com.kasem.receive_sharing_intent.ReceiveSharingIntentPlugin.getMediaUris(ReceiveSharingIntentPlugin.kt:117)
E/AndroidRuntime(28362):    at com.kasem.receive_sharing_intent.ReceiveSharingIntentPlugin.handleIntent(ReceiveSharingIntentPlugin.kt:91)
E/AndroidRuntime(28362):    at com.kasem.receive_sharing_intent.ReceiveSharingIntentPlugin.onNewIntent(ReceiveSharingIntentPlugin.kt:206)
E/AndroidRuntime(28362):    at io.flutter.embedding.engine.FlutterEngineConnectionRegistry$FlutterEngineActivityPluginBinding.onNewIntent(FlutterEngineConnectionRegistry.java:799)