skip to Main Content

My app is not building because of this error and I am not able to understand the error. I tried ‘flutter upgrade’ and ‘flutter get’ but nothing was helpful.

Launching lib/main.dart on SM A127F in debug mode...
Running Gradle task 'assembleDebug'...
../../flutter/.pub-cache/hosted/pub.dartlang.org/fwfh_text_style-2.7.3+2/lib/fwfh_text_style.dart:11:7: Error: The non-abstract class 'FwfhTextStyle' is missing implementations for these members:
 - TextStyle.fontVariations
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 FwfhTextStyle extends _TextStyleProxy {
      ^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/painting/text_style.dart:789:33: Context: 'TextStyle.fontVariations' is defined here.
  final List<ui.FontVariation>? fontVariations;
                                ^^^^^^^^^^^^^^ 


FAILURE: Build failed with an exception.

* Where:
Script '/home/vrs/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1159

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/home/vrs/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 16s
Exception: Gradle task assembleDebug failed with exit code 1

6

Answers


  1. I think this is about the definition of final List<ui.FontVariation>? fontVariations;

    Whether it’s defined at the last indexes or it’s not defined at all.

    I’d do something like that to prevent an error. List<ui.FontVariation> fontVariations = [];

    Login or Signup to reply.
  2. After I upgraded to Flutter 3.3.0 this error appearing to me

    After some searching I resolved it by run upgrade for packages in my project

    flutter pub upgrade 
    

    then

    flutter clean 
    
    flutter pub get
    
    Login or Signup to reply.
  3. Please try it out by upgrading the dependency flutter pub upgrade fwfh_text_style

    Login or Signup to reply.
  4. I tried flutter upgrade and then flutter clean but it didn’t work for me.

    I then run this command flutter pub outdated and it worked good.

    Login or Signup to reply.
  5. Try to add fwfh_text_style this plugin in your project if not added. It works for me.

    Login or Signup to reply.
  6. I had to run rm -rf ~/.pub-cache and then flutter pub get 🤷🏻‍♂️

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search