Skip to content

FileType.audio picking not showing, crash due Platform exception invalid_format_type, Can't handle the provided file type #1917

@langhoangal

Description

@langhoangal

Describe the bug
As the title, when call to pick a file, nothing happens, just crash silently.
E/FilePickerDelegate( 1270): Can't find a valid activity to handle the request. Make sure you've a file explorer installed.
I/flutter ( 1270): [MethodChannelFilePicker] Platform exception: PlatformException(invalid_format_type, Can't handle the provided file type., null, null)
I/flutter ( 1270): ----------------FIREBASE CRASHLYTICS----------------
I/flutter ( 1270): PlatformException(invalid_format_type, Can't handle the provided file type., null, null)
I/flutter ( 1270): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:653:7)
message_codecs.dart:653
I/flutter ( 1270): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:367:18)
platform_channel.dart:367
I/flutter ( 1270):
I/flutter ( 1270): #2 MethodChannel.invokeListMethod (package:flutter/src/services/platform_channel.dart:553:35)
platform_channel.dart:553
I/flutter ( 1270):
I/flutter ( 1270): #3 FilePickerIO._getPath (package:file_picker/src/file_picker_io.dart:107:33)
file_picker_io.dart:107

This one will throw exception:
FilePickerResult? result = await FilePicker.platform.pickFiles( allowMultiple: false, type: FileType.audio, );

This one works
FilePickerResult? result = await FilePicker.platform.pickFiles( allowMultiple: false, type: FileType.custom, allowedExtensions: ['mp3', 'wav', 'm4a', 'aac', 'ogg'], );

I have Pixel 8 with original rom, cannot be an issue with the file explorer, should be something file the file mime.

Platform

  • [ x] Android
  • iOS
  • Web
  • Desktop

Platform OS version
16

Some additional info:

  1. using the latest version 10.3.7
  2. Already clean & rebuild
  3. Search for other issues but not found the solution

Metadata

Metadata

Assignees

No one assigned

    Labels

    new issueAn issue that hasn't yet been seen from the maintainer

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions