I just updated flutter version from 2.5.3 to 2.8. I have the following error that i dont know how resolve it. There is no error on any plugin installed, It seems that the error comes from the inner classes themselves and I don't know in which part of my application the error is throwed:
../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_math_fork-0.3.3+1/lib/src/widgets/selectable.dart:407:7: Error: The non-abstract class 'InternalSelectableMathState' is missing implementations for these members:
- TextSelectionDelegate.copySelection
- TextSelectionDelegate.cutSelection
- TextSelectionDelegate.pasteText
- TextSelectionDelegate.selectAll
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 InternalSelectableMathState extends State<InternalSelectableMath>
^^^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/desarrollo/flutter/packages/flutter/lib/src/services/text_input.dart:985:8: Context: 'TextSelectionDelegate.copySelection' is defined here.
void copySelection(SelectionChangedCause cause);
^^^^^^^^^^^^^
/C:/desarrollo/flutter/packages/flutter/lib/src/services/text_input.dart:965:8: Context: 'TextSelectionDelegate.cutSelection' is defined here.
void cutSelection(SelectionChangedCause cause);
^^^^^^^^^^^^
/C:/desarrollo/flutter/packages/flutter/lib/src/services/text_input.dart:973:16: Context: 'TextSelectionDelegate.pasteText' is defined here.
Future<void> pasteText(SelectionChangedCause cause);
^^^^^^^^^
/C:/desarrollo/flutter/packages/flutter/lib/src/services/text_input.dart:979:8: Context: 'TextSelectionDelegate.selectAll' is defined here.
void selectAll(SelectionChangedCause cause);
^^^^^^^^^
FAILURE: Build failed with an exception.
* Where:
Script 'C:\desarrollo\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1070
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\desarrollo\flutter\bin\flutter.bat'' 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 8m 5s
Exception: Gradle task assembleDebug failed with exit code 1
I dont have declared flutter_math_fork
on my pubspec.
My flutter doctor output:
Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 2.8.0, on Microsoft Windows [Versión 10.0.19041.1348], locale es-ES) [√] Android toolchain - develop for Android devices (Android SDK version 31.0.0) [√] Chrome - develop for the web [√] Android Studio (version 2020.3) [√] VS Code (version 1.62.3) [√] Connected device (3 available) • No issues found!
I have tried: flutter clean, flutter upgrade and invalidate cache / restart.
Any suggestion is appreciated.
I have solved it by forcing update flutter_math_fork
adding to pubspec:
flutter_math_fork: ^0.5.0
I dont know why flutter install flutter_math_fork-0.3.3+1
when i upgrade to 2.8 stable version.
I have solved this with
flutter pub upgrade --major-versions
First Try to update your flutter_math_fork
to 0.6.0 but in my case
I got the same error after updating the flutter version to 2.8.1 and I can't update flutter_math_fork
to latest version because I was using Provider version 5.0.0
and flutter_math_form
require provider version 6.0.0+
. So until upgrading other libraries you can modified /lib/src/widgets/selectable.dart
this file. add this line.
@override
dynamic noSuchMethod(Invocation invocation) {
// We override noSuchMethod since we do not have concrete implementations
// for all methods of the selection manager mixins.
throw NoSuchMethodError.withInvocation(this, invocation);
}
}
remove this method
@override
void bringIntoView(TextPosition position) {}
@override
void userUpdateTextEditingValue(
TextEditingValue value, SelectionChangedCause cause) {}
}
Or just copy paste this
Add to your pubspec.yaml. It's worked for me.
dependency_overrides:
flutter_math_fork: ^0.5.0
provider: ^6.0.2
I got this error when building only with codemagic, but not on my local M1 mac.
One of my dependencies (flag) had a conflict with flutter_math_fork: ^0.5.0.
I was able to get it work with flutter_math_fork: ^0.4.2+2. Codemagic build succeeded.
I faced the same error, i add following codes to pubscpec.yaml, it's working now. If it doesn't work you can follow the above methods
dependency_overrides:
provider: 6.0.0
In my case:
Step 1: Update the dependencies in pubspec.yaml with the following:
Step 2: Run flutter pub get
Step 3: Run: flutter run
Good luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With