I am facing a strange issue with my Flutter android application where it behaves differently in the release build downloaded from the Google Play Store compared to when it is installed locally via a debug or release APK.
Problem:
- When the app is launched while the device is offline (no internet connection), it automatically redirects to the Google Play Store page of the app.
- When the app is launched while the device is online, it functions normally without any issues.
- This problem occurs only in the release build that is installed from the Google Play Store. It does not occur when the release build APK is installed directly on the device or during debugging.
I have verified that this redirection is not due to an explicit intent or code logic in the app.
I finally identified the root cause of the issue and was able to fix it.
The problem was due to Automatic Integrity Protection being enabled on the Google Play Store. When this feature is enabled, it can interpret offline usage as suspicious activity and redirect the user to the app’s Google Play Store page.
To resolve the issue, I disabled Automatic Integrity Protection, and the app now works correctly even when launched offline.
You can learn more about this feature and how it works in the official Google Play documentation.