Flutter file_selector plugin fails on iOS with MissingPluginException

Viewed 113

Trying to use the file_selector Flutter Plugin across platforms.

I had no issues getting everything working on MacOS.

But, on iOS, I get: Unhandled Exception: MissingPluginException(No implementation found for method openFile on channel plugins.flutter.io/file_selector)

class Scopes extends StatelessWidget {
  void openVCDFile() async {
    final typeGroup = XTypeGroup(label: 'VCD Files', extensions: ['vcd']);
    final file = await openFile(acceptedTypeGroups: [typeGroup]);
    print('${file?.path}');
  }

  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisSize: MainAxisSize.min,
      mainAxisAlignment: MainAxisAlignment.start,
      children: [
        Container(
          color: Color(0xFF52c7b8),
          width: double.infinity,
          height: 40,
          child: Row(
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              IconButton(onPressed: () => openVCDFile(), icon: Icon(Icons.import_contacts)),
            ],
          ),
        ),
      ],
    );
  }
}

My pubspec.yaml file:

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  file_selector: ^0.8.2
  file_selector_windows: ^0.0.2
  file_selector_macos: ^0.0.4
  file_selector_linux: ^0.0.2

It's a bit odd that this works with no issues on MacOS (had to add the entitlements), but fails on iOS.

Any ideas?

0 Answers
Related