Android users report my Flutter app locks their screen on start

Hi,

I recently released my app on both iOS and Android. I only have a real apple device to test on so i hired testers to test it for android devices, and i used various android emulators myself. The testers using real devices said that when they opened my app their phones locked. When they unlocked their phones, the app was then open.

I could not reproduce this bug on the emulators so i went ahead and released the app publicly. However, I just had a user report the same issue. This issue does not happen on iOS.

Has anyone run into this? I would really like to fix this before more people download the app. The codebase is fairly large so i don’t know what to include here to help you identify the issue.

here is the output from flutter --version:
Flutter 3.29.3 • channel stable • GitHub - flutter/flutter: Flutter makes it easy and fast to build beautiful apps for mobile and beyond
Framework • revision ea121f8859 (6 weeks ago) • 2025-04-11 19:10:07 +0000
Engine • revision cf56914b32
Tools • Dart 3.7.2 • DevTools 2.42.3

Here are the libraries i am using:
cupertino_icons: ^1.0.8
fl_chart: ^0.70.2
sqflite: ^2.4.0
sqflite_common_ffi: null
sqlite3_flutter_libs: null
path: ^1.9.0
intl: ^0.19.0
table_calendar: ^3.1.2
flutter_launcher_icons: ^0.14.1
pdf: ^3.11.2
path_provider: ^2.1.5
share_plus: ^10.1.4
archive: ^4.0.4
url_launcher: ^6.3.1
in_app_purchase: ^3.1.13
in_app_purchase_storekit: ^0.3.21
in_app_purchase_android: ^0.4.0+1
shared_preferences: ^2.5.3
open_file: ^3.5.10
permission_handler: ^12.0.0+1

For all those who come here with a similar problem, this is a problem with the flutter_launcher_icons package. It is an open issue. The solution is to remove the package from pubspec and create the android icons manually in android studio.

https://stackoverflow.com/questions/79630611/android-users-report-my-flutter-app-locks-their-screen-on-start/79630628#79630628

1 Like

I don’t understand how flutter_launcher_icons could be causing this issue?

The StackOverflow i linked to has a link to the library’s open issue. The issue page does a better job of describing how the package creates a bad file, but it seems to be to do with mipmap-anydpi-v26 folder. If you read the symptoms in the issue page, one of the effects is taking the user to the lock screen. In any case, using android studio to generate the icon and replace the one created by this package did indeed fix the bug.

The issue isn’t open, it’s closed because a PR was opened to close the original issue and fix the issue of the icon being blank if adaptive icon config wasn’t set.

You had this issue because you were using an older version of flutter_launcher_icon (0.14.1) and not the version with the fix (0.14.2) but the newest version is 0.14.3.

If you use the newest version to setup your icons OR if you set adaptive icons correctly then I’m assuming you wouldn’t have had this issue although it does seem very strange that this can cause freezing on the start screen.

I’d recommend opening an issue with the Flutter team, because if it is true that an incorrectly set icon can cause this type of behaviour then the Flutter team needs to have a fix for it.