miguelpruivo / flutter_file_picker

File picker plugin for Flutter, compatible with mobile (iOS & Android), Web, Desktop (Mac, Linux, Windows) platforms with Flutter Go support.
MIT License
1.35k stars 673 forks source link

Default plugins for linux/macos/windows need to register implementation; warning on latest Flutter #1555

Closed gnprice closed 3 months ago

gnprice commented 4 months ago

Describe the bug

Building an app using file_picker and Flutter from main, with a Flutter version since https://github.com/flutter/flutter/pull/137040 last week, produces these warnings (taken from full output below):

Package file_picker:linux references file_picker:linux as the default plugin, but it does not provide an inline implementation.
Ask the maintainers of file_picker to either avoid referencing a default implementation via `platforms: linux: default_package: file_picker` or add an inline implementation to file_picker via `platforms: linux:` `pluginClass` or `dartPluginClass`.

Package file_picker:macos references file_picker:macos as the default plugin, but it does not provide an inline implementation.
Ask the maintainers of file_picker to either avoid referencing a default implementation via `platforms: macos: default_package: file_picker` or add an inline implementation to file_picker via `platforms: macos:` `pluginClass` or `dartPluginClass`.

Package file_picker:windows references file_picker:windows as the default plugin, but it does not provide an inline implementation.
Ask the maintainers of file_picker to either avoid referencing a default implementation via `platforms: windows: default_package: file_picker` or add an inline implementation to file_picker via `platforms: windows:` `pluginClass` or `dartPluginClass`.

In fact just flutter pub get is enough to produce these warnings.

So here I am doing as the warnings say, by asking you to do as the warnings say :slightly_smiling_face:

There's a bit of a lack of documentation of this new warning. Perhaps you already know what it's saying, but in case it's helpful here's how another plugin fixed a similar warning: https://github.com/MaikuB/flutter_local_notifications/pull/2371 https://github.com/MaikuB/flutter_local_notifications/issues/2368

Platform

Platform OS version n/a (happens at flutter pub get time)

How are you picking? n/a

Details to reproduce the issue

Run flutter pub get after cloning this repo: https://github.com/zulip/zulip-flutter (while using a recent Flutter from the main/master channel, commit d55a5f96c117725c134099b78deb7af431a93902 or later)

Or see the logs of this CI run: https://github.com/zulip/zulip-flutter/actions/runs/10000051702/job/27641881195

Error Log

``` $ flutter pub get Resolving dependencies... Downloading packages... _fe_analyzer_shared 70.0.0 (73.0.0 available) _flutterfire_internals 1.3.37 (1.3.39 available) analyzer 6.5.2 (6.8.0 available) collection 1.18.0 (1.19.0 available) drift 2.18.0 (2.19.1+1 available) drift_dev 2.18.0 (2.19.1 available) file_picker 8.0.4 (8.0.6 available) firebase_core 3.1.0 (3.2.0 available) firebase_core_web 2.17.2 (2.17.3 available) firebase_messaging 15.0.1 (15.0.3 available) firebase_messaging_platform_interface 4.5.39 (4.5.41 available) firebase_messaging_web 3.8.9 (3.8.11 available) flutter_local_notifications 17.2.1 (17.2.1+2 available) flutter_local_notifications_linux 4.0.0+1 (4.0.1 available) graphs 2.3.1 (2.3.2 available) http 1.2.1 (1.2.2 available) http_parser 4.0.2 (4.1.0 available) image_picker_android 0.8.12+3 (0.8.12+6 available) material_color_utilities 0.11.1 (0.12.0 available) path_provider_android 2.2.5 (2.2.7 available) path_provider_windows 2.2.1 (2.3.0 available) pigeon 20.0.1 (21.0.0 available) shelf 1.4.1 (1.4.2 available) sqlite3 2.4.3 (2.4.4 available) sqlite3_flutter_libs 0.5.23 (0.5.24 available) sqlparser 0.36.0 (0.37.0 available) timezone 0.9.3 (0.9.4 available) url_launcher_android 6.3.3 (6.3.5 available) url_launcher_ios 6.3.0 (6.3.1 available) uuid 4.4.0 (4.4.2 available) video_player 2.8.7 (2.9.1 available) video_player_android 2.5.0 (2.5.2 available) web 0.5.1 (1.0.0 available) web_socket 0.1.5 (0.1.6 available) web_socket_channel 3.0.0 (3.0.1 available) Got dependencies! 35 packages have newer versions incompatible with dependency constraints. Try `flutter pub outdated` for more information. Package file_picker:linux references file_picker:linux as the default plugin, but it does not provide an inline implementation. Ask the maintainers of file_picker to either avoid referencing a default implementation via `platforms: linux: default_package: file_picker` or add an inline implementation to file_picker via `platforms: linux:` `pluginClass` or `dartPluginClass`. Package flutter_local_notifications:linux references flutter_local_notifications_linux:linux as the default plugin, but the package does not exist. Ask the maintainers of flutter_local_notifications to either avoid referencing a default implementation via `platforms: linux: default_package: flutter_local_notifications_linux` or create a plugin named flutter_local_notifications_linux. Package file_picker:macos references file_picker:macos as the default plugin, but it does not provide an inline implementation. Ask the maintainers of file_picker to either avoid referencing a default implementation via `platforms: macos: default_package: file_picker` or add an inline implementation to file_picker via `platforms: macos:` `pluginClass` or `dartPluginClass`. Package file_picker:windows references file_picker:windows as the default plugin, but it does not provide an inline implementation. Ask the maintainers of file_picker to either avoid referencing a default implementation via `platforms: windows: default_package: file_picker` or add an inline implementation to file_picker via `platforms: windows:` `pluginClass` or `dartPluginClass`. Package file_picker:linux references file_picker:linux as the default plugin, but it does not provide an inline implementation. Ask the maintainers of file_picker to either avoid referencing a default implementation via `platforms: linux: default_package: file_picker` or add an inline implementation to file_picker via `platforms: linux:` `pluginClass` or `dartPluginClass`. Package flutter_local_notifications:linux references flutter_local_notifications_linux:linux as the default plugin, but the package does not exist. Ask the maintainers of flutter_local_notifications to either avoid referencing a default implementation via `platforms: linux: default_package: flutter_local_notifications_linux` or create a plugin named flutter_local_notifications_linux. Package file_picker:macos references file_picker:macos as the default plugin, but it does not provide an inline implementation. Ask the maintainers of file_picker to either avoid referencing a default implementation via `platforms: macos: default_package: file_picker` or add an inline implementation to file_picker via `platforms: macos:` `pluginClass` or `dartPluginClass`. Package file_picker:windows references file_picker:windows as the default plugin, but it does not provide an inline implementation. Ask the maintainers of file_picker to either avoid referencing a default implementation via `platforms: windows: default_package: file_picker` or add an inline implementation to file_picker via `platforms: windows:` `pluginClass` or `dartPluginClass`. ```

Screenshots and/or video n/a

Flutter Version details

$ flutter --version
Flutter 3.24.0-1.0.pre.182 • channel main • https://github.com/flutter/flutter.git
Framework • revision af0e01c370 (8 hours ago) • 2024-07-18 09:22:18 -0700
Engine • revision d58ba74250
Tools • Dart 3.6.0 (build 3.6.0-54.0.dev) • DevTools 2.37.1

Additional context

sgehrman commented 3 months ago

same issue building on master branch

Megatronicus commented 3 months ago

I'm also getting this issue after doing flutter upgrade

Package file_picker:linux references file_picker:linux as the default plugin, but it does not provide an inline implementation. Ask the maintainers of file_picker to either avoid referencing a default implementation via platforms: linux: default_package: file_picker or add an inline implementation to file_picker via platforms: linux: pluginClass or dartPluginClass.

Package file_picker:macos references file_picker:macos as the default plugin, but it does not provide an inline implementation. Ask the maintainers of file_picker to either avoid referencing a default implementation via platforms: macos: default_package: file_picker or add an inline implementation to file_picker via platforms: macos: pluginClass or dartPluginClass.

Package file_picker:windows references file_picker:windows as the default plugin, but it does not provide an inline implementation. Ask the maintainers of file_picker to either avoid referencing a default implementation via platforms: windows: default_package: file_picker or add an inline implementation to file_picker via platforms: windows: pluginClass or dartPluginClass.

Package file_picker:linux references file_picker:linux as the default plugin, but it does not provide an inline implementation. Ask the maintainers of file_picker to either avoid referencing a default implementation via platforms: linux: default_package: file_picker or add an inline implementation to file_picker via platforms: linux: pluginClass or dartPluginClass.

Package file_picker:macos references file_picker:macos as the default plugin, but it does not provide an inline implementation. Ask the maintainers of file_picker to either avoid referencing a default implementation via platforms: macos: default_package: file_picker or add an inline implementation to file_picker via platforms: macos: pluginClass or dartPluginClass.

Package file_picker:windows references file_picker:windows as the default plugin, but it does not provide an inline implementation. Ask the maintainers of file_picker to either avoid referencing a default implementation via platforms: windows: default_package: file_picker or add an inline implementation to file_picker via platforms: windows: pluginClass or dartPluginClass.

Package file_picker:linux references file_picker:linux as the default plugin, but it does not provide an inline implementation. Ask the maintainers of file_picker to either avoid referencing a default implementation via platforms: linux: default_package: file_picker or add an inline implementation to file_picker via platforms: linux: pluginClass or dartPluginClass.

Package file_picker:macos references file_picker:macos as the default plugin, but it does not provide an inline implementation. Ask the maintainers of file_picker to either avoid referencing a default implementation via platforms: macos: default_package: file_picker or add an inline implementation to file_picker via platforms: macos: pluginClass or dartPluginClass.

Package file_picker:windows references file_picker:windows as the default plugin, but it does not provide an inline implementation. Ask the maintainers of file_picker to either avoid referencing a default implementation via platforms: windows: default_package: file_picker or add an inline implementation to file_picker via platforms: windows: pluginClass or dartPluginClass.

Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel master, 3.24.0-1.0.pre.217, on Microsoft Windows [Version 10.0.19045.4651], locale en-US) [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [√] Chrome - develop for the web [√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.3) [√] Android Studio (version 2024.1) [√] VS Code (version 1.89.1) [√] Connected device (4 available) [√] Network resources

Android Studio Koala Feature Drop 2024.1.2

file_picker: ^8.0.6

flutter_local_notifications: ^17.2.1+2

Ran flutter pub upgrade --major-versions - still got the same error, is there another way to solve this?

alok511 commented 3 months ago

Yes I am getting the same issue

github-actions[bot] commented 3 months ago

This issue is stale because it has been open for 7 days with no activity.

gnprice commented 3 months ago

Stale-bot please go away; there's no reason to believe the bug has been fixed.

Abdelrahmankhaledabdallahabdallah commented 3 months ago

same problem please help

gnprice commented 3 months ago

At https://github.com/miguelpruivo/flutter_file_picker/issues/1562#issuecomment-2263666017, @Zelkreps reports similar warning messages, and then:

Error (Xcode): Package file_picker:linux references file_picker:linux as the default plugin, but it does not provide an inline implementation.

My project only uses Android and iOS platform and everything works on Android.

@Zelkreps, does that mean that on iOS for you the build actually fails with these messages? If so, that's a more severe issue than this had been. The symptoms I'm seeing are only that flutter run and flutter test and other commands print these warning messages, which get noisy — but the commands all continue to work just fine.

Zelkreps commented 3 months ago

At #1562 (comment), @Zelkreps reports similar warning messages, and then:

Error (Xcode): Package file_picker:linux references file_picker:linux as the default plugin, but it does not provide an inline implementation. My project only uses Android and iOS platform and everything works on Android.

@Zelkreps, does that mean that on iOS for you the build actually fails with these messages? If so, that's a more severe issue than this had been. The symptoms I'm seeing are only that flutter run and flutter test and other commands print these warning messages, which get noisy — but the commands all continue to work just fine.

I already figured it out, and it wasn't anyone's fault but mine. Somehow, mysteriously, flutter on my development Mac was upgraded from the stable version to the development version (you can see it in the flutter doctor dump), but I didn't notice it before, so I apologize. Everything is working and thanks for the quick response! :)

gnprice commented 3 months ago

OK, thanks for the followup.

FWIW when things don't work on the master/main channel, that's still a bug that someone will need to fix :slightly_smiling_face:. In general in the Flutter ecosystem, the main channel is expected to work, and many people — including Google in all their own uses of Flutter — use the main channel rather than stable.

In this instance, the warning messages are currently only in main; but the code that's in main now can be expected to be in the next beta and the next stable, so they'll appear there too unless something changes first.

gnprice commented 3 months ago

It looks like #1567 was intended to fix this issue, and has been merged (thanks @Sameri11 and @navaronbracke!).

And indeed after an upgrade to package:file_picker 8.0.7, which has that change, I no longer see this issue. So, closing as fixed.