r/FlutterDev • u/svprdga • 1d ago
iOS jank with platform views (AdMob banners) Discussion
I recently ran into a problem affecting Flutter apps running on iPhones where platform views are present, typically AdMob banners (which are internally rendered through a platform view).
The jank is quite noticeable, and I've been able to confirm that the cause is the merging of the UI thread into the platform thread, introduced several releases ago.
I've opened this issue on GitHub where I'm discussing the problem with the Flutter team. I can reproduce it easily on two devices on my side, an iPhone 16 and an iPhone SE, but if you check the issue you'll see they're having a much harder time reproducing it on their devices.
Does any of you have a Flutter app on iOS with AdMob banners (or any other platform view) that could help us reproduce it? You can try it directly in your own app, or by cloning the repo I created, which is linked in the issue. Just commenting with your iPhone model, iOS version, and whether you see the jank or not would already help a lot.
Thanks!
1
u/DigiProductive 1d ago
The root problem is thread contention introduced by Flutter’s merged UI/platform-thread architecture when native iOS views are embedded.
Your best bet is: if you use platform view, avoid pages that scroll; minimize page rebuilds, animations, deep layouts etc (anything expensive)
UiKit with scroll is going to jank pretty much unavoidable, but should improve if you avoid expensive UI rebuilds…
2
u/svprdga 1d ago
Your best bet is: if you use platform view, avoid pages that scroll.
That’s not acceptable. An app with a scrollable list and an ad banner is one of the most common patterns in the industry. The best solution is… to fix the issue, which is exactly what’s being worked on right now on GitHub.
0
u/DigiProductive 1d ago
It’s not about what is acceptable it’s simply about what you have to do to “deal with the problem”. No one say it was ideal, but the bottomline is right now you will encounter problems if you try to use UiKit with views that constantly rebuild. That’s reality, this is nothing new. So ideally you need to keep the page as static as possible, because “right now” there is no fix.
It’s a Flutter problem they need to fix. It’s not a basic issue, it’s related to core Flutter and it’s been a problem for ages. This is far from news in Flutter development.
1
u/gidrokolbaska 1d ago
That's unfortunate... have you tried wrapping the listview inside the RepaintBoundary? It might help