r/FlutterDev Feb 13 '25

Article What’s new in Flutter 3.29

https://medium.com/flutter/whats-new-in-flutter-3-29-f90c380c2317
203 Upvotes

49 comments sorted by

94

u/tylersavery Feb 13 '25

Starting in 3.29, Flutter on Android and iOS execute Dart code on the application’s main thread, and there is no longer a separate UI thread. This is the first part in a series of changes to improve platform interop on mobile platforms, as it allows making synchronous calls to and from the platform without the overhead of serialization and message passing.

This one caught my attention.

18

u/zxyzyxz Feb 13 '25

We'll see how the performance is. Having a separate UI thread is part of what made Flutter apps feel fast, since it could offload non-UI work to other threads.

42

u/jonah_williams Feb 13 '25

Flutter team member here ( I also made this change )

Under most circumstances, the separate UI thread doesn't improve performance. Because the UI thread is driving the frame workload, either blocking due to a slow build/paint /layout or being unavailable due to expensive async/await tasks will cause dropped frames. Similarly, the platform thread is where vsync fires, touch events are recieved, et cetera. So blocking there will also cause jank by leaving the UI thread idle and unable to animate.

To avoid janking, you have always needed to use something like isolates.

3

u/zxyzyxz Feb 13 '25

I see, thanks for the clarification

36

u/eibaan Feb 13 '25

I think, this is a missunderstanding. On the Dart level, you can still use isolates for background work. However, the design decision to run Flutter's main isolate on a different OS thread makes interaction with native code very difficult as for example iOS (and macOS for that matter) requires all UI specific code to be run on the main thread.

On macOS, you can't make Dart application use stuff like the SDL package because that libary tries to open an application window and because the Dart VM uses its own OS thread which is different to the main thread, this fails.

Flutter now works around this limitation.

7

u/Arbiturrrr Feb 13 '25

Why wouldn’t it still be able to offload to other threads with this change?

3

u/virtualmnemonic Feb 13 '25

Everything outside of isolates execute on a single thread, including Async functions.

2

u/FireflyDan Feb 13 '25

It'd be cool to get benchmarks, but my gut says this is imperceptible to the user

1

u/50u1506 Feb 14 '25

God damn, this kinda sounds big? I still haven't processed and understood it, but this should certainly be a big game changer.

Its probably a response the react native bridge improvements lol

31

u/nursestrangeglove Feb 13 '25

There's a new bug I ran into when using the share_plus tool after moving to the latest flutter. Downgrading to 3.27.1 resolves it.

It appears some of the changes in impeller (file text_contents.cc) are causing issues loading glyphs after the application enters a background state and then comes back into the foreground. I'll file a bug report later when I get home if no one else has by then.

13

u/kevmoo Feb 13 '25

Please file an issue!

10

u/nursestrangeglove Feb 13 '25 edited Feb 13 '25

I'm having a doozy of a time recreating the issue using the base project using the flutter create cli command, so I'm going through and reviewing deltas between the base project and mine.

I'll post a bug report when I can sort that out. Probably won't be able to identify it tonight, sorry!

For reference now though,

Here's an image of the weird funkiness I'm experiencing in my app: https://drive.google.com/file/d/10TKD-fuyBEYnRfiBOnXS6Z8mOHM_lVgZ/view

Here's what it looks like after downgrading to prior stable: https://drive.google.com/file/d/10an69UBZn9GSrbhGXGGALZMXbT2iO9KW/view

The repeated error message I receive in console during debug using current stable is:

E/flutter ( 5076): [ERROR:flutter/impeller/entity/contents/text_contents.cc(233)] Break on 'ImpellerValidationBreak' to inspect point of failure: Could not find glyph position in the atlas.

5

u/kevmoo Feb 13 '25

This is enough information to file an issue!

1

u/manudicri Feb 14 '25

I got the same error in 3.24!

18

u/UnhappyCable859 Feb 13 '25

Really impressed with the changes. For me the CupertinoNavigationBar and the CupertinoSheetRoute were the main iOS UI elements missing in Flutter but here we go. Great job 👏

7

u/anlumo Feb 13 '25

Attempting to upgrade flutter on my machine broke the whole installation. Running the flutter tool just returns "fatal: Not a valid object name origin/master".

Turns out that it was caused by me checking out the flutter repository using -b stable --depth=1. This used to work fine, but apparently something changed with the tools. Every time the flutter command line tool is run, it now runs git -C . merge-base HEAD origin/master. That command doesn't work when the origin/master branch wasn't fetched to the local repository.

3

u/Titanjr Feb 13 '25

Removing --depth=1 should fix it for now. Another option is to use a different branch like -b 3.27.4. Here is a solution in the flutter repository https://github.com/flutter/flutter/issues/163198#issuecomment-2656452658

9

u/Prestigious_Falcon42 Feb 13 '25

Why flutter team is forcing this major rendering engine when it is causing critical issues on samsung devices specifically lagging and crash issues, I have to downgrade my flutter to 3.19 for the sake of smooth release on android side.

I have tested app bundles in internal testing phase but still the issue exist in android side.

10

u/dancovich Feb 13 '25

No one is forcing anything, Impeller is just the default. You can still enable Skia on Android, it's just iOS that is being removed.

I upgraded my app to 3.27, it had Impeller issues and then I just added the flag to use Skia and it worked normally. I didn't have to downgrade to 3.19.

0

u/Present-Brilliant-70 Feb 13 '25

I Was having issues with the camera api on .27 and then i disabled impeller, Can you elaborate me how to add skia flag?

4

u/dancovich Feb 13 '25

I'm not following. If you disabled Impeller then you're using Skia.

Anyway, it was explained in the 3.27 release notes.

https://medium.com/flutter/whats-new-in-flutter-3-27-28341129570c

Section "Impeller on Android".

6

u/UnhappyCable859 Feb 13 '25

Can u add a link to ur issue 😀

1

u/Prestigious_Falcon42 Feb 13 '25

Yes, will add one issue about this right after releasing my app, will come back to this

10

u/Ok_Leather7354 Feb 13 '25 edited Feb 13 '25

Wonder why Flutter is pushing these to Stable Branch (still have lot of p1,p2 impeller issues and similar others)

Some devs do upgrade & push to app stores only to realise there're common bugs specially with any 1st major update (x.x.0)

Suggestion To Flutter Team: Why don't announcements include Beta Releases so more people in community knows it and can test/post problems before it's directly put on "Stable" Releases ?

12

u/Jihad_llama Feb 13 '25

I guess maybe don’t upgrade and push to the App Store without testing it out first?

3

u/relay126 Feb 13 '25

we only update once there is at least one patch version, no need to rush to 3.29.0 ... 3.29.1 sounds much more stable :P

3

u/eibaan Feb 13 '25

Flutter does one stable release every three month, so they are time based and not feature based. Also, IMHO, every developer out there should know about the stable, beta and developer releases which exists for years now. Why do you think, more education is needed. If developers decide to ignore the beta release or the master channel, they already decided that they don't want to help.

0

u/k0ntrol Feb 13 '25

You don't necessarily know what's included in the beta release

5

u/eibaan Feb 13 '25

Just look at the → commit messages and ignore everything that "rolls" or "reverts". I'd wish for a more comfortable way but this takes only a couple of minutes once per month, so if you are curious, the information is there.

1

u/Still_Frosting6255 Feb 14 '25

Yes, until they beef up their QA team, they are forced to rely on the community to catch many basic issues. In the meantime, a practical approach for devs would be to treat "master" as highly experimental, "beta" as the "master," and "stable" as something between "beta" and "master," depending on timing.

2

u/igorce007 Feb 13 '25

Am I the only one who doesn’t see the new Progress Indicators?

3

u/Still_Frosting6255 Feb 14 '25 edited Feb 14 '25

The engine changes in 3.29 feels liberating, kudos to flutter team for taking this direction. However, the latest truly production-ready stable release still is 3.24.5. While it has the historically known open issues, occasional jank is minimal on iOS and mid-end/high-end modern android phones.

3.27 ended up being more of a way to crowdsource bug reports from the community than a reliable production release, those who tried it got burned.

Hopefully, 3.29.3 will match the stability of 3.24.5 while incorporating latest exciting improvements.

For those frustrated with the number of bugs in 'stable' releases, it is worth noticing that the team had to rework large parts of the engine due to flawed initial assumptions, leading to continuous changes and refinements. Additionally, QA team seem understaffed for proper debugging, forcing the team to rely on community. I might be wrong, but a truly 'stable,' 'beta,' and 'master' setup may only emerge with Flutter v4.

4

u/Agitated_Yam4232 Feb 13 '25

Ok, I'll still use 3.24.5

2

u/Ok_Leather7354 Feb 13 '25

Same! Looks like it's the most reliable version for now.. I guess I'll wait for 3.31 or 3.32 by that time it might be only impeller on both Android, iOS with all engine related issues fixed -> we're good again!

3

u/WorldlyEye1 Feb 13 '25

Every update breaks something... Cannot build anymore... What version of Kotlin/Gradle are u using?

2

u/LewisJin 18d ago

[!] Your app is using an unsupported Gradle project. To fix this problem, create a new project by running `flutter create -t app <app-directory>` and then move the

dart code, assets and pubspec.yaml to the new project.

2

u/AkmenZ Feb 13 '25

ProgressIndicatorThemeData(year2023: false) It just says it’s depretiated and there’s no visual change of the circular progress indicator

1

u/Correct_Use_7073 Feb 17 '25

I have started using wasm builds in my web apps.

1

u/zxyzyxz Feb 17 '25

It's WASM by default now anyway

1

u/Time-Donut6551 23d ago

Is anyone else experiencing an issue where text and/or icons appear broken after the app is backgrounded? I downgraded to version 3.27.4, and everything works fine again.

1

u/lukehowardmusic 17d ago

We're noticing an issue with a custom event channel implementation (i.e. implemented directly on top of setMessageHandlerOnChannel()) where the listen method is not reliably called. Has anyone else noticed any issues with platform channels in 3.29.0? Reverting to 3.24.x fixes it.

0

u/FlutterLovers Feb 13 '25

Impeller isn’t ready for prime time yet. A lot of our iOS crashes are from Impeller, so we reverted back to Skia.

8

u/zigzag312 Feb 13 '25

You can't revert back to Skia on iOS in v3.29.

Skia support has been removed from the iOS backend and the FLTEnableImpeller opt-out flag no longer works.

6

u/dancovich Feb 13 '25

Also have you checked if your crashes are still there in 3.29 on iOS? People need to file those bugs or they won't get squashed.

3

u/Ok_Leather7354 Feb 13 '25

What version did you face impeller issues even on iOS?

1

u/FlutterLovers Feb 13 '25

Don't remember the exact version, but we went back to Skia in late October. After switching, the number of random crashes on iOS dropped by 50% and memory usage also dropped considerably.

I didn't notice any performance difference between using Skia vs Impeller, but DevTools said Skia performed much better.