-
Notifications
You must be signed in to change notification settings - Fork 28.5k
After upgrading to Flutter 3.7.6 flutter analyze is throwing an error about "Multiple plugins can't be enabled" #121836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for the report @cfsbhawkins console log
See https://github.com/flutter/flutter/wiki/Hotfixes-to-the-Stable-Channel#376-mar-01-2023 for fixes pushed in Are there any specific steps to replicate that you can share that triggers the error by the analyzer ? |
I am also experiencing this "issue". This is my analysis yaml: include: package:lint/analysis_options.yaml
analyzer:
errors:
...
exclude:
...
plugins:
- dart_code_metrics
- custom_lint
... I get the warning on the line with |
It does look like that change is what is causing it. We run the two plugins to verify code quality, but as well as making sure we did not have hard coded strings at pull request time. I guess to upgrade to newer flutter versions we will need to decide what we care most about, or hope that dart_code_metrics or something picks up string literals. |
It does not appear to me that it runs that second plugin, as we had some string literals get into the code. |
@cfsbhawkins |
Yes. I understand why its throwing the error. I guess if this is the way it is now, we will have to find other linter plugins that can do all the checks we need. |
Thanks for the update. Is it safe to close this issue as resolved ? |
@cfsbhawkins, @leventkantaroglu, @Maatteogekko and others running into this, please consider to join the discussion at dart-code-checker/dart-code-metrics#1213 about fixing this in dart_code_metrics or other solutions. |
This restriction is now documented on the dart.dev website. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Is there an existing issue for this?
Steps to reproduce
I have a flutter analysis setup in my project, it has a few plugins it loads. After upgrading flutter to 3.7.6 from 3.7.5 nothing seems to run because it throws an warning about "Multiple plugins can't be enabled" when you open dart analysis in android studio. Reverting my change in pubspec and doing a flutter downgrade back to 3.7.5 fixes the issue.
Was a breaking change introduced in 3.7.6?
`analyzer:
exclude:
- "plugins/components/lib/l10n/"
- "plugins/map/lib/l10n/"
- "plugins/repository/lib/l10n/"
- "lib/generated/"
- "ios/"
- "/.graphql.dart"
- "**/.g.dart"
- "**/*.freezed.dart"
plugins:
- dart_code_metrics
- string_literal_finder
strong-mode:
implicit-casts: false
implicit-dynamic: true
errors:
close_sinks: ignore
missing_return: error
missing_required_param: error
unrelated_type_equality_checks: error
deprecated_member_use_from_same_package: ignore
invalid_use_of_visible_for_testing_member: error
invalid_use_of_protected_member: error
import_of_legacy_library_into_null_safe: ignore
string_literal_finder:
exclude_globs:
- "/*.graphql.dart"
- "/.g.dart"
- "**/.freezed.dart"
dart_code_metrics:
anti-patterns:
- long-method
metrics:
cyclomatic-complexity: 20
maximum-nesting: 5
rules:
- newline-before-return
- no-equal-then-else
- member-ordering:
order:
- public_fields
- private_fields
- constructors
linter:
rules:
- annotate_overrides
- avoid_empty_else
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
- avoid_print
- avoid_relative_lib_imports
- avoid_renaming_method_parameters
- avoid_return_types_on_setters
- avoid_returning_null
- avoid_types_as_parameter_names
- avoid_unused_constructor_parameters
- avoid_void_async
- await_only_futures
- camel_case_types
- cancel_subscriptions
- cascade_invocations
- comment_references
- constant_identifier_names
- control_flow_in_finally
- directives_ordering
- empty_catches
- empty_constructor_bodies
- empty_statements
- hash_and_equals
- implementation_imports
- iterable_contains_unrelated_type
- library_names
- library_prefixes
- list_remove_unrelated_type
- no_adjacent_strings_in_list
- no_duplicate_case_values
- non_constant_identifier_names
- null_closures
- only_throw_errors
- package_api_docs
- package_names
- package_prefixed_library_names
- prefer_adjacent_string_concatenation
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_contains
- prefer_equal_for_default_values
- prefer_final_fields
- prefer_initializing_formals
- prefer_interpolation_to_compose_strings
- prefer_is_empty
- prefer_is_not_empty
- prefer_single_quotes
- prefer_typing_uninitialized_variables
- recursive_getters
- slash_for_doc_comments
- test_types_in_equals
- throw_in_finally
- type_init_formals
- unawaited_futures
- unnecessary_await_in_return
- unnecessary_brace_in_string_interps
- unnecessary_const
- unnecessary_getters_setters
- unnecessary_lambdas
- unnecessary_new
- unnecessary_null_aware_assignments
- unnecessary_statements
- unnecessary_this
- unrelated_type_equality_checks
- use_rethrow_when_possible
- valid_regexps
`
Actual results
In 3.7.5:

Warning in 3.7.6:

Logs
No response
Flutter Doctor output
Flutter doctor on 3.7.5:
`[✓] Flutter (Channel stable, 3.7.5, on macOS 13.2.1 22D68 darwin-x64, locale en-US)
• Flutter version 3.7.5 on channel stable at /Users/XXX/FlutterSDK/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c07f788 (8 days ago), 2023-02-22 17:52:33 -0600
• Engine revision 0f359063c4
• Dart version 2.19.2
• DevTools version 2.20.1
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at /Users/XXX/Library/Android/sdk
• Platform android-33, build-tools 33.0.0
• Java binary at: /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14C18
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[!] Android Studio (version 2022.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
✗ Unable to find bundled Java version.
• Try updating or re-installing Android Studio.
[✓] VS Code (version 1.75.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.58.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-x64 • macOS 13.2.1 22D68 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 110.0.5481.177
[✓] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.
`
Flutter doctor on 3.7.6:
`[✓] Flutter (Channel stable, 3.7.6, on macOS 13.2.1 22D68 darwin-x64, locale en-US)
• Flutter version 3.7.6 on channel stable at /Users/XXX/FlutterSDK/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 12cb4eb (28 hours ago), 2023-03-01 10:29:26 -0800
• Engine revision ada363ee93
• Dart version 2.19.3
• DevTools version 2.20.1
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at /Users/XXX/Library/Android/sdk
• Platform android-33, build-tools 33.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14C18
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
[✓] VS Code (version 1.75.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.58.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-x64 • macOS 13.2.1 22D68 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 110.0.5481.177
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
`
The text was updated successfully, but these errors were encountered: