Closed ElaineSchwner closed 4 years ago
Well, the error seems clear here @ElaineSchwner, looks like multiple requests are being made at once.
Could you please try on the plugin's example app? Thank you.
@miguelpruivo The plugin's example app has the same error.
flutter: [FilePicker] Platform exception: PlatformException(multiple_request, Cancelled by a second request, null) flutter: Unsupported operationPlatformException(multiple_request, Cancelled by a second request, null)
When file type is choosen, for example, from audio. The first click on Open file picker and seems to load forever. The error will be printed out after the second click.
@namchuai that's actually an error to expect, as you can see in the error description, it was thrown due to a second request being made — when you tap again, which isn't actually supposed.
The FileType.audio
opens the music app and won't work on simulator. You need to try on a real device and have in mind that won't let you pick DRM protected files as well.
If you need to pick your own music files, from Files app, for example, just use FileType.custom
with allowedExtensions
set to something like ['mp3', 'ogg', 'wav']
etc.
Thanks for very quick reply and clear explaination.
thanks for the solution
Describe the bug getFile with FileType doesn't work on iOS.
Future getFile() async {
File file = await FilePicker.getFile(type: FileType.audio);
return file;
}
Issue details
Error Log flutter: [FilePicker] Platform exception: PlatformException(multiple_request, Cancelled by a second request, null) 2020-04-03 12:24:20.769179-0300 Runner[767:85752] [VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: PlatformException(multiple_request, Cancelled by a second request, null)
0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569)
1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321)