Android builds are being rejected by Google

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?

2 Likes

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 =(

2 Likes

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.

You should still be able to use 3.29 but disable impeller in AndroidManifest.

And how long will that continue to work?

Rejected
Mar 11, 2025, 11:44 PM
Your app has the following functionality issue(s):
Problems loading
Your app does not open or load

I’m going to scream.

We currently stay on 3.24.3 because of the image bug on iOS. Do you have to use the latest version currently?

1 Like

Not, not particularly. I did try using 3.27… I guess I’ll try rolling back to 3.24 and seeing if that works. This is so frustrating.

1 Like

Dropping all the way down to 3.24.5 worked. They accepted the build. To be clear, no other changes were made. In the end, @evaluator118 was spot on.

This is absolutely unacceptable.

2 Likes

Let’s maybe try to get some upvotes on this. Android builds using Flutter >3.24.5 are rejected by Google · Issue #165052 · flutter/flutter · GitHub

2 Likes

Had you read what I wrote?

Problem is, there is always that guy:

I have five apps on Google Play and App Store using Flutter version 3.29.1 and they all submitted fine.

So, if works on his machine, then it is automatically your fault. What a an absolute useless thing to say :frowning:

1 Like

Well, that bug went nowhere. They refuse to even investigate the issue further. Android builds using Flutter >3.24.5 are rejected by Google · Issue #165052 · flutter/flutter · GitHub

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).

I just switched back to 3.29.1 and built a new apk. Here’s the link.

Tested on Samsung S21 (Android 14), Oppo A54 (Android 13) and it worked well, no crashes :confused:
It doesn’t install on Motorola G6 (Android 9). It worked well on Moto G6 as well.

That’s been my experience with every device I’ve thrown it at. I have no idea what Google Play does to make it crash.

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.

Just some thoughts… Hope you’re making progress.

DNS resolving is a blocking I/O? This kind of Dart I/O (which will be always handled by the OS) are blocking I/O?

Also, the last entry is dedicated to Impeller :smiling_imp: