I’ve got a weird situation where all my Android builds are being rejected by Google because they “hang when launched.” Unfortunately, I’m not able to reproduce the issue, nor am I given any logs or other diagnostic information whatsoever to aid in my troubleshooting of the issue.
My major changes were:
Switching from Flutter 3.24.3 to 3.29.1
Migrating build.gradle to build.gradle.kts
Copying the gradle.properties from a new Flutter app to this one
Appending android.enableR8.fullMode = false to gradle.properties
Upgrading Gradle from 7.6.1 to 8.10.2
Migrating settings.gradle to settings.gradle.kts
Adding synthetic-package: false to l10n.yaml
I haven’t been able to reproduce the app hanging on launch. I’ve tried two different physical devices and the emulator in both debug and release mode. I’ve tried running directly from flutter run as well as building an apk and installing it.
The email that I get from Google says I should check the Play console for ANRs - and the build I submitted doesn’t show up at all there. I’ve also checked our external logging system and I don’t see any logs being reported for that build.
I’ve been working on this issue for a couple of weeks now. My first order of business was to upgrade Gradle and migrate to the new Kotlin system. (I was still getting the same ANR reports from Google prior to this - so I don’t think that’s the issue.)
I’m about at my wit’s end trying to figure out what’s going on. Does anybody have any ideas?
That’s called “The 3.27” [Insert suspense music here]
In 3.27, Google is forcing us to use Impeller instead of Skia. But, Impeller doesn’t work on a lot of Android GPUs out there, and even if works, it is so slow that actually generates ANR and even app crashes (just saw yesterday a fragment shader crashing a Samsung J4, while it works flawlesly on iPhones).
I have an app with dozens of millions of users that uses 3.24.5 and it works just fine. The moment I updated to Flutter 3.27, there were tons of crashes, black screens and my ANR was above the bad-behaviour line.
Disabling Impeller or updating Flutter to a version which they said things were fixed actually fixed the black screens, but the ANRs was out of line so… I use FVM to keep Flutter 3.24.5 around =(
That first spike was 3.27. The second one was 3.27 with Impeller disabled (fixed ANRs but crashes went up, quickly). The third was a revert to 3.24.5 and then finally a final update to change a plugin that was not supported anymore in 3.24.5 (which gives me the current acceptable ANR/Crashrate of 0.07% of crashes and 0.25% of ANR (my bad-behaviour lines are 1.1% and 0.45%)
The problem with Impeller is that it doesn’t work at all on low-end devices (and even some mid-end). But my country is poor, so they dominate the market.
Also, Impeller has some weird thing going on. Shaders in Impeller are so slow that often crashes the entire app on low-end devices. This is nuts, because shaders are hardware accelerated stuff that should be fast. Somehow, Impeller makes hardware code worst >.<
And, I’m in the same boat as you: eventually, Flutter 3.24 will not be usable anymore and I’ll have to deal with the upgrade =(
This is the best/worst news I’ve had all day! At least it’s a useful answer! I’m going to try building with flutter 3.24 to see if they’ll accept that build. If they do, and that’s the only change, something really needs to be done by the Flutter team to address this.
I’ll report back if/when they approve/reject the build.
Would you mind sharing the same apk/aab or link to internal app sharing to Google Play, so that it goes through the same processing (even privately)? I’m happy to try to just launch the app across my Android devices (oldest is Android 9).
Tested on Samsung S21 (Android 14), Oppo A54 (Android 13) and it worked well, no crashes It doesn’t install on Motorola G6 (Android 9). It worked well on Moto G6 as well.
I have bought dozens of devices because of those kind of bugs (and some Flutter black screens), and they always worked (except for black screens).
Also paid for Google Test Lab to test problematic devices and, guess what? It always worked.
But, as usual, there is a library embedded in every single software in the world with this code: if(onImportantMeet || onStakeholderTest || onFinalCustomer || onAppStoreCheck) throw Exception("Hello, there! My name is Murphy!");
You’ve probably already tried this, but be sure to test the app with all networking disabled on first-run. It’s possible Google is testing additional new bad-network situations now, than when they did the last time you submitted the app. (Just a theory.)
I believe part of the google automated sandbox testing includes launching the app in an environment with a very adversarial network. I suspect, but can’t prove, that apps are run behind a MiTM SSL-stripping or SSL-swapping proxy, to validate that invalid SSL certificates are rejected. It’s only a guess based on some extremely weird SSL failures I see in my server-logs while the automated testing is going on.
It’s possible they test for other broken networking situations (no DNS, super slow sockets, etc)… If you have an await’ed network dependency in main, before the widget tree is set up, that could be one source of the problem.
Using contents of this forum for the purposes of training proprietary AI models is forbidden. Only if your AI model is free & open source, go ahead and scrape. Flutter and the related logo are trademarks of Google LLC. We are not endorsed by or affiliated with Google LLC.