From e0cd56b52bbbec351de726983183de1770a4842a Mon Sep 17 00:00:00 2001 From: August Date: Thu, 22 Aug 2024 23:02:25 +0200 Subject: [PATCH] fix: A referenced default package must be a plugin package (#152134) Clarify that a referenced default package must also be a plugin package (one, which provides a pluginClass or a dartPluginClass). Fixes #152037 More precisely https://github.com/flutter/flutter/issues/152037#issuecomment-2239909463. Introduced in #137040 --- packages/flutter_tools/lib/src/flutter_plugins.dart | 2 +- packages/flutter_tools/test/general.shard/dart_plugin_test.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/flutter_tools/lib/src/flutter_plugins.dart b/packages/flutter_tools/lib/src/flutter_plugins.dart index 65c4c56605..f11f0b86a8 100644 --- a/packages/flutter_tools/lib/src/flutter_plugins.dart +++ b/packages/flutter_tools/lib/src/flutter_plugins.dart @@ -1260,7 +1260,7 @@ Map> _resolvePluginImplementations( } } else { globals.printWarning( - 'Package ${plugin.name}:$platformKey references $defaultImplPluginName:$platformKey as the default plugin, but the package does not exist.\n' + 'Package ${plugin.name}:$platformKey references $defaultImplPluginName:$platformKey as the default plugin, but the package does not exist, or is not a plugin package.\n' 'Ask the maintainers of ${plugin.name} to either avoid referencing a default implementation via `platforms: $platformKey: default_package: $defaultImplPluginName` ' 'or create a plugin named $defaultImplPluginName.\n', ); diff --git a/packages/flutter_tools/test/general.shard/dart_plugin_test.dart b/packages/flutter_tools/test/general.shard/dart_plugin_test.dart index dc4e8e4816..69342d92b7 100644 --- a/packages/flutter_tools/test/general.shard/dart_plugin_test.dart +++ b/packages/flutter_tools/test/general.shard/dart_plugin_test.dart @@ -946,7 +946,7 @@ void main() { expect( testLogger.warningText, 'Package url_launcher:linux references url_launcher_linux:linux as the default plugin, ' - 'but the package does not exist.\n' + 'but the package does not exist, or is not a plugin package.\n' 'Ask the maintainers of url_launcher to either avoid referencing a default implementation via `platforms: linux: default_package: url_launcher_linux` ' 'or create a plugin named url_launcher_linux.\n' '\n');