在构建诸如flutter_form_builder,flutter_chips_input
之类的第3方软件包时,services
软件包也会出错,这会导致构建失败,我认为这是软件包版本崩溃的问题....但是,我可以不能解决这个问题...
我该如何解决?
下面是错误代码。
谢谢。
错误代码
../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_form_builder-3.7.2/lib/src/fields/form_builder_range_slider.dart:21:9: Error: Type 'RangeSemanticFormatterCallback' not found.
final RangeSemanticFormatterCallback semanticFormatterCallback;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_chips_input-1.6.1/lib/src/chips_input.dart:62:7: Error: The non-abstract class 'ChipsInputState' is missing implementations for these members:
- TextInputClient.currentAutofillScope
- TextInputClient.currentTextEditingValue
- TextInputClient.performPrivateCommand
- TextInputClient.showAutocorrectionPromptRect
Try to either
- provide an implementation,
- inherit an implementation from a superclass or mixin,
- mark the class as abstract, or
- provide a 'noSuchMethod' implementation.
class ChipsInputState<T> extends State<ChipsInput<T>>
^^^^^^^^^^^^^^^
../flutter/packages/flutter/lib/src/services/text_input.dart:805:22: Context: 'TextInputClient.currentAutofillScope' is defined here.
AutofillScope? get currentAutofillScope;
^^^^^^^^^^^^^^^^^^^^
../flutter/packages/flutter/lib/src/services/text_input.dart:793:25: Context: 'TextInputClient.currentTextEditingValue' is defined here.
TextEditingValue? get currentTextEditingValue;
^^^^^^^^^^^^^^^^^^^^^^^
../flutter/packages/flutter/lib/src/services/text_input.dart:814:8: Context: 'TextInputClient.performPrivateCommand' is defined here.
void performPrivateCommand(String action, Map<String, dynamic> data);
^^^^^^^^^^^^^^^^^^^^^
../flutter/packages/flutter/lib/src/services/text_input.dart:823:8: Context: 'TextInputClient.showAutocorrectionPromptRect' is defined here.
void showAutocorrectionPromptRect(int start, int end);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../flutter/.pub-cache/hosted/pub.dartlang.org/flushbar-1.9.1/lib/flushbar_route.dart:273:8: Error: The method 'FlushbarRoute.install' has more required arguments than those of overridden method 'OverlayRoute.install'.
void install(OverlayEntry insertionPoint) {
^
../flutter/packages/flutter/lib/src/widgets/routes.dart:46:8: Context: This is the overridden method ('install').
void install() {
^
../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_form_builder-3.7.2/lib/src/fields/form_builder_range_slider.dart:21:9: Error: 'RangeSemanticFormatterCallback' isn't a type.
final RangeSemanticFormatterCallback semanticFormatterCallback;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../flutter/.pub-cache/hosted/pub.dartlang.org/flushbar-1.9.1/lib/flushbar_route.dart:281:18: Error: Too many positional arguments: 0 allowed, but 1 found.
Try removing the extra positional arguments.
super.install(insertionPoint);
^
FAILURE: Build failed with an exception.
* Where:
Script '/Users/gabriel/Git/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 900
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/gabriel/Git/flutter/bin/flutter'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 32s
##############解决方案事物###############
这种情况是由于选择了错误的软件包版本引起的。 因此,我尝试更改“ flutter_form_builder”的版本! 我解决了这个问题!
答案 0 :(得分:2)
删除std::vector
,删除pubspec.lock
,然后运行
podfile.lock
答案 1 :(得分:2)
这是由于flutter_form_builder与您的flutter版本不兼容。根据flutter_form_builder的github页上的建议,您需要根据您的flutter版本选择插件。
在github页面上:
对于Flutter 1.17.x,请使用版本3.12.x
对于Flutter 1.20.x,请使用版本3.13.x
对于Flutter 1.22.X,请使用版本3.14.x
您必须在pubspec.yaml中输入正确的版本号