Skip to content

Android freeze at launch when the app has been "killed" while in background #814

Open
@jeromecaudoux

Description

@jeromecaudoux

Describe the bug
When I put the app in background, after some time when it get "killed" by Android it is not possible to open the app anymore because it freeze.

To Reproduce
Steps to reproduce the behavior:

  1. Clone the branch master of https://github.com/juicycleff/flutter-unity-view-widget
  2. Follow the instructions of the README.md to export the folder unityLibrary of the DemoApp. I used the Unity Editor version 2021.3.25f1 (Set in Unity Hub and local.properties) and file fuw-2022.2.0.unitypackage.
  3. Go in the Developper Settings of the devive and enable "Don't keep activities" to force Android to kill the app as soon as it get in background. Otherwise we would have to wait a random amount of time to trigger the kill. (cf: first screenshot)
  4. Launch the app, go to "Simple Unity Demo"
  5. Simply put the app in background. You will get "Lost connection to device." in the log.
  6. Try to open the app again and it will freeze (cf: second screenshot).

Expected behavior
I would like the be able to launch the app again and see the Menu List at least. Actually I have to kill the app manually and open it again after the freeze.

Screenshots
Screenshot_2023-05-24-11-02-12-619_com android settings
Screenshot_2023-05-24-10-50-15-315_com xraph plugin flutter_unity_widget_example
Screenshot_2023-05-24-11-01-53-428_com android settings

Unity (please complete the following information):

  • OS: Windows 11
  • Version Editor Version 2021.3.25f1

Smartphone (please complete the following information):

  • Device: Redmi Note 9S (cf: third screenshot)
  • OS: Android
  • Version: Android 11

Additional context
I have the same issue when I replace the DemoAPP by my own Unity app. And when I build an apk from Unity directly (of my own app), there is no freeze with the same steps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    androidThis issue is specific to the Android Platform.bugThis issue refers to a bug in the plugin

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions