Flutter 3.10.1 breaks starter projects

Picking up on Flutter where I left off a few months ago. I noticed that upgrading to the latest version of Flutter (3.10.1 at this point) seemed break the starter projects from the ftla-materials github repository. I even made sure to pull a fresh copy of the repository but still ran into build errors related to google fonts.

I found at least in 4th and 5th chapter starter projects required editing the pubspec.yaml to upgrade the google_fonts package to ^4.0.5 then doing a pub upgrade.

That at least allowed the projects to built and deploy to my Android phone again.

Seems were are still in the move fast and break things with Flutter?

Thanks!

2 Likes

Hello, and welcome to the forum! :wave:

Flutter and Dart are developing rapidly, and changes between major versions can sometimes cause issues like the one you’re experiencing.

I have removed a paragraph and edited my post, as the Flutter version command is deprecated and already removed from Flutter. For the solution, refer to @geoffdcw’s answer below

On the topic of version numbers, Dart’s jump from 2.x.x to 3.x.x is a major change. The version number is in the MAJOR.MINOR.PATCH format. Major changes can include backwards-incompatible changes, sometimes breaking existing projects. Minor changes usually add functionality in a backwards-compatible manner, and patches are typically for backwards-compatible bug fixes.

The pace of updates can be hard to keep up with, and sometimes, they cause a few headaches! But remember, each new version also brings improvements and fresh features, so there’s a bright side to it too.

I hope this helps!

1 Like

Thanks for posting this @lauragales!

In the meantime, yes, we are working on an update to the book :slight_smile:

2 Likes

Thanks for the quick reply. Super appreciated!

While the command:

flutter version

was not valid for my installation of flutter (perhaps it is --version ? maybe the markdown editor ate the double hyphens? Using backticks seems to help). I did discover I could do instead:

flutter downgrade

followed by:

flutter doctor

This brought me back to my previous version prior to my upgrade this morning. Now the flta projects built again, unmodified. What started me on the upgrade path, though, were warnings by flutter doctor to accept the android licenses, which then resulted in a crash:

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/prefs/AndroidLocationsProvider has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

As well, flutter doctor warning that Android Studio could not find the bundled Java version.

Doing the flutter upgrade fixed all that, but then broke the starter apps.

In exploring Flutter for our production work (enterprise apps), having a stable toolchain that doesn’t break our build process is important, especially if I’m going to convince my colleagues to try Flutter. Obviously not your team’s fault, and I’m sure you share the same concern for a different reason: the book source code goes stale quickly at the pace that Flutter evolves. Didn’t we go through something similar last year with Flutter 2…

That said, as you pointed out, with the interruptions of upgrades come improvements (we hope!).

1 Like

How come the issues in the Errata for Flutter Apprentice 3rd Edition are not addressed?

Márton

The 3rd is still the current edition. We’ll address those in the upcoming one, the 4th, which we are working on.

1 Like

Thank you @geoffdcw, for highlighting the issue with my answer. I have not downgraded Flutter or Dart for a while. The Flutter version command is deprecated and has already been removed from Flutter. I have edited my previous reply to reflect this.

2 Likes

So you won’t even reply to the topic whether those reports have any merit or not?
Should I stop reporting the bugs?

Please continue :slight_smile:
Authors periodically read errata and reply on the forums.
Thanks for those you already reported.

Keep reporting the bugs :muscle:. The books and supporting GitHut repositories are updated when necessary, especially in response to feedback from the community.

When Flutter 3.0.0 was released in May last year, it caused a few issues trying to follow the book’s examples, Kodeco was quick to release updates, and I am sure this will also be the case this time.

1 Like

Great to hear, and appreciate the updates! I can’t quite imagine the work involved keeping a book like this current with such a moving target. Just glad to be back building again. :smiley:

1 Like

is it possible to hope that in the fourth version of the book we will really study Flutter and not packages from pub such as provider/riverpod or getx let’s study what the sdk already has and not the packages…

@urbanmarton I’m trying to understand your comment. When you say this, to what are you referring?

How come the issues in the Errata for Flutter Apprentice 3rd Edition are not addressed?

Are you referring to comments here in the forum or are you referring to book updates?

is it possible to hope that in the fourth version of the book we will really study Flutter and not packages from pub such as provider/riverpod or getx let’s study what the sdk already has and not the packages…

Developing in Flutter is often about leveraging resources in the Flutter dev world, which include popular and recommended packages. Google even recommends packages such as Provider/Riverpod and Go_Router. The latter is now managed by the Google team.

Is there something specific subjects you feel are missing?

of course, when you are already an established developer, it is better to take a proven package, but if you are at the beginning of studying the framework, then you need to learn what it provides and not wrappers over its already existing functionality
ps: and google does not recommend using helper methods and use widgets

1 Like

the main question is, are we here to study Flutter or just to show how to use it to make an application?
if the answer is studying Flutter then let’s not waste time studying wrappers
well, if the answer is the second, then let’s drag getx and reduce the amount of material in two, what will such a developer know about Flutter? nothing…

Thank you for addressing the issue.
I meant the pinned thread in the Flutter Apprentice category, where I recently reported multiple possible bugs/errata (I might still contribute in the near future as I am still going through the book):
https://forums.kodeco.com/t/errata-for-flutter-apprentice-3rd-edition/178204

Kindest Regards,
Márton Urbán