Flutter and false flutter_test dependency
I could no longer resolve the flutter_test dependency and did not want to change the flutter channel. Here you can find the solution
Again a chapter where I got a bug in Flutter and I had to solve it somehow.
The following error came now more often:
Because every version of flutter_test from sdk depends on path 1.6.4 and app_name depends on path ^1.7.0, flutter_test from sdk is forbidden.
So, because app_name depends on flutter_test any from sdk, version solving failed.
Running "flutter pub get" in easy-by-design-flutter...
pub get failed (1; So, because app_name depends on flutter_test any from sdk, version solving failed.)
Up to now I have always solved this error by changing the flutter channel. But I did not want to do that this time. I wanted to stay on the Stable Channel.
So I did some research and deleted the pubcache and the lockfile:
rm -rf ~/.pub-cache
rm -rf pubspec.lock
flutter pub get
The error persisted. After that I looked at all versions in pubspec.yaml and updated them manually.
The error persisted. Silly error!
After some research I found the following command:
flutter update-packages --force-upgrade
After many packages were updated, I could run the flutter pub get again and build the project again.