Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve: `uses-material-design: true` set but the primary pubspec contains `uses-material-design: false`

Me, and some of my colleagues who updated to Flutter 3.27.4 are getting this error when running tests:

<your_package> has `uses-material-design: true` set but the primary pubspec contains `uses-material-design: false`. If the application needs material icons, then `uses-material-design`  must be set to true.

The pubspec.yaml file in the root of the project has uses-material-design: true, and still, we get this error.

root pubspec

...

flutter:
  uses-material-design: true

  assets:
    - assets/images/

We are using a pub workspace with a lot of packages, and they all get this error too. Does anyone know how to solve it?

like image 806
Joel Broström Avatar asked Dec 09 '25 16:12

Joel Broström


1 Answers

All packages in a pub workspace must agree on the setting for uses-material-design. Even though your root pubspec sets it to true, some of your other package pubspecs may have set it to false (or omitted, thereby defaulting to false)? :)

Setting all occurrences to true should solve the issue. Good luck!

like image 121
DeltaMike Avatar answered Dec 12 '25 00:12

DeltaMike



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!