Low performance with Flutter 3 on iOS devices
See original GitHub issueI found performance issues with Flutter 3.0.1
, with Dart 2.17.1
, using the google_mobile_ads 1.2.0
on iOS.
Obs.: Using LARGE_BANNER ad.
I think this is realted to google_mobile_ads
and iOS
. Android works pretty well, without any issues.
Evidence video
Plugin Version
google_mobile_ads: ˆ1.2.0
Steps to Reproduce
- Create some example app using flutter 3.0.1
- Add google_mobile_ads version 1.2.0 and use Banner Ad on different pages of your app.
- Navigate between pages with real banners ids - on TEST MODE (simulates real ads)
Expected results: Fluid navigation
Actual results: Performance issues
flutter doctor -v
[✓] Flutter (Channel stable, 3.0.1, on macOS 12.4 21F79 darwin-x64, locale pt-BR)
• Flutter version 3.0.1 at /Users/cello/fvm/versions/3.0.1
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision fb57da5f94 (6 days ago), 2022-05-19 15:50:29 -0700
• Engine revision caaafc5604
• Dart version 2.17.1
• DevTools version 2.12.2
[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/cello/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• ANDROID_HOME = /Users/cello/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 13.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-x64 • macOS 12.4 21F79 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 101.0.4951.64
[✓] HTTP Host Availability
• All required HTTP hosts are available
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:34 (5 by maintainers)
Top Results From Across the Web
Flutter & its 'poor' iOS performance | by Thomas Middel - Medium
This means when you install a Flutter app and then trigger an animation, it'll stay in cache after that (clearing memory and app...
Read more >Performance - Flutter documentation
Flutter performance basics. What is performance? Why is performance important? How do I improve performance? Our goal is to answer those three questions ......
Read more >Flutter ios performance : r/FlutterDev - Reddit
Because it is (or was?) a bug in Flutter. Keep in mind that Apple tends to change things in iOS that could result...
Read more >Flutter Performance Optimization Techniques
In quick scrolling across large images, memory usage is reduced by 70% · For simple ios animations, there is a 40% drop in...
Read more >iOS Simulator bad performance after run flutter upgrade
If you are experiencing slowness, low FPS, laggy scrolling on specific (newer) devices in Xcode simulator that's because Apple dropped ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
With Flutter 3.0 the performance on iOS is so bad…
I had the same issue and could reproduce it running a debug build on a real device with real ads - and only occurs on iOS.
It occurs when the ad moves across the screen because of some animation (like the navigation transition animation in the @marcellocamara video above). In my case it is when the software keyboard appears and pushes the ad up from the bottom of the screen. The debug console rapidly fills with hundreds of the following logs:
[WindowServer] CADisplayTimingsControl too many requests. [WindowServer] Unmatched CAFrameIntervalRange unregistration.
Within a minute or two performance declines and the logs start to fire hundreds of times a second and most touch interactions are followed by 10 to 20 secs of screen freeze.
Those specific errors indicate it may be related to 120hz refresh rate introduced with ProMotion in iOS 15.x.
For me it was resolved by converting the widget that serves the ad to be a Stateful widget and then ensuring the ad is disposed along the lines of the code sample supplied by @maheshmnj.