You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The app crashes when invoking the saveFile method from FilePicker on a device running Android API 35. The crash occurs due to a NullPointerException when attempting to write to a file.
Steps to Reproduce
Use a device or emulator running Android API 35.
Call the following method:
returnawaitFilePicker.platform.saveFile(
dialogTitle:'Please select an output file:',
fileName:'output-file.maso',
initialDirectory:'/data/user/0/com.example.maso/cache/file_picker/1735558385877/example.maso');
Select a file in the file picker dialog.
Expected Behavior
The file picker should successfully allow the user to save the file without crashing the app.
Actual Behavior
The app crashes with the following stack trace:
E/AndroidRuntime( 6271): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=43700, result=-1, data=Intent { dat=content://com.android.providers.downloads.documents/... flg=0x43 }} to activity {com.example.maso/com.example.maso.MainActivity}: java.lang.NullPointerException: Attempt to get length of null array
E/AndroidRuntime( 6271): at android.app.ActivityThread.deliverResults(ActivityThread.java:5878)
E/AndroidRuntime( 6271): at android.app.ActivityThread.handleSendResult(ActivityThread.java:5917)
E/AndroidRuntime( 6271): at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:69)
E/AndroidRuntime( 6271): at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:60)
E/AndroidRuntime( 6271): at android.app.servertransaction.TransactionExecutor.executeNonLifecycleItem(TransactionExecutor.java:174)
E/AndroidRuntime( 6271): at android.app.servertransaction.TransactionExecutor.executeTransactionItems(TransactionExecutor.java:109)
E/AndroidRuntime( 6271): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:81)
E/AndroidRuntime( 6271): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2636)
E/AndroidRuntime( 6271): at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime( 6271): at android.os.Looper.loopOnce(Looper.java:232)
E/AndroidRuntime( 6271): at android.os.Looper.loop(Looper.java:317)
E/AndroidRuntime( 6271): at android.app.ActivityThread.main(ActivityThread.java:8705)
E/AndroidRuntime( 6271): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 6271): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
E/AndroidRuntime( 6271): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
E/AndroidRuntime( 6271): Caused by: java.lang.NullPointerException: Attempt to get length of null array
E/AndroidRuntime( 6271): at java.io.FileOutputStream.write(FileOutputStream.java:409)
E/AndroidRuntime( 6271): at com.mr.flutter.plugin.filepicker.FilePickerDelegate.onActivityResult(FilePickerDelegate.java:84)
E/AndroidRuntime( 6271): at io.flutter.embedding.engine.FlutterEngineConnectionRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEngineConnectionRegistry.java:774)
E/AndroidRuntime( 6271): at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.onActivityResult(FlutterEngineConnectionRegistry.java:422)
E/AndroidRuntime( 6271): at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:964)
E/AndroidRuntime( 6271): at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:911)
E/AndroidRuntime( 6271): at android.app.Activity.onActivityResult(Activity.java:7494)
E/AndroidRuntime( 6271): at android.app.Activity.internalDispatchActivityResult(Activity.java:9379)
E/AndroidRuntime( 6271): at android.app.Activity.dispatchActivityResult(Activity.java:9356)
E/AndroidRuntime( 6271): at android.app.ActivityThread.deliverResults(ActivityThread.java:5867)
E/AndroidRuntime( 6271): ... 14 more
The text was updated successfully, but these errors were encountered:
Summary
The app crashes when invoking the
saveFile
method fromFilePicker
on a device running Android API 35. The crash occurs due to aNullPointerException
when attempting to write to a file.Steps to Reproduce
Expected Behavior
The file picker should successfully allow the user to save the file without crashing the app.
Actual Behavior
The app crashes with the following stack trace:
The text was updated successfully, but these errors were encountered: