Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening android app twice causes a freeze (configured as Launcher/Home app) #53716

Closed
likeich opened this issue Oct 12, 2021 · 8 comments · Fixed by #61333
Closed

Opening android app twice causes a freeze (configured as Launcher/Home app) #53716

likeich opened this issue Oct 12, 2021 · 8 comments · Fixed by #61333

Comments

@likeich
Copy link
Contributor

likeich commented Oct 12, 2021

Godot version

3.3.4 stable

System information

Android 11 GLES 2

Issue description

Opening an app twice in android is causing a freeze that did not happen in Godot 3.3.3. My app is an android launcher that allows users to click a button to go to the settings menu to set their default launcher. Clicking this button and selecting my app (World Launcher) in 3.3.3 would correctly restart the app as the default launcher instead of as a normal app. In 3.3.4 this causes a freeze and a black screen as shown below:

Screen_Recording_20211012-084523_World.Launcher.mp4

The app is not crashing, so I do not have a stack trace, but here are the logcat errors when this happens:

Screenshot from 2021-10-12 08-53-47

Steps to reproduce

I don't think this is reproducible without using android custom builds. First, install the custom build template, then replace the intent filter with
<intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.HOME" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter>
to allow setting the app as the default launcher.

Export that app then leave the app running in the background and go to your settings and set it as the default launcher and the freeze will occur when android tries to start the app as the default launcher.

Minimal reproduction project

It looks like I can't upload an MRP because the custom build template makes it too large. Following the steps above should hopefully suffice.

Edit: I created a repo with the MRP Here

@Calinou
Copy link
Member

Calinou commented Oct 12, 2021

It looks like I can't upload an MRP because the custom build template makes it too large. Following the steps above should hopefully suffice.

You can create a GitHub repository that contains the project and the build template. Alternatively, you can upload the MRP without the build template included.

@Calinou Calinou added this to the 3.3 milestone Oct 12, 2021
@akien-mga akien-mga modified the milestones: 3.3, 3.4 Oct 25, 2021
@akien-mga
Copy link
Member

akien-mga commented Oct 25, 2021

Do you have the same issue with 3.4 RC 1?

CC @godotengine/android.

There aren't many Android-related changes between 3.3.3 and 3.3.4: 3.3.3-stable...3.3.4-stable

In fact, I reviewed the whole diff and I really don't see much that could explain a situation where the application seems to initialize itself twice, or fail cleaning itself between two instances. Are you positive that 3.3.3-stable works fine and 3.3.4-stable doesn't? Did you make sure to reinstall the build template for 3.3.4?

@m4gr3d
Copy link
Contributor

m4gr3d commented Oct 25, 2021

@likeich That may be related to the logic that was added to resolve #51021, although that logic was also included in 3.3.3 so if that's the cause, the issue should have started there.

Can you add logging statements in your logic to check how many we're creating and using a Godot fragment instance.
It's possible a previous instance of the Godot fragment may not be properly cleaned up leading to that state.

As @akien-mga suggested as well, can you check if this still occurs with Godot 3.4.

@likeich
Copy link
Contributor Author

likeich commented Oct 30, 2021

Akien was right. From my testing, 3.3.2 and 3.3.3 all have this issue as well.

Confirmed to still be an issue on Godot 3.4 RC 2.
Logcat:
Screenshot from 2021-10-30 11-17-26

@m4gr3d where would I put logging statements to track that?

@akien-mga akien-mga changed the title Opening android app twice causes a freeze Opening android app twice causes a freeze (configured as Launcher/Home app) Nov 1, 2021
@akien-mga akien-mga modified the milestones: 3.4, 3.5 Nov 8, 2021
@akien-mga
Copy link
Member

Is this still reproducible in 3.5 beta 5 or later?

@likeich
Copy link
Contributor Author

likeich commented May 15, 2022

@akien-mga yes, I just reproduced it on 3.5 beta 5.

Screenshot from 2022-05-14 17-52-19

@m4gr3d
Copy link
Contributor

m4gr3d commented May 23, 2022

@likeich PR #61332 should address the issue you're seeing. Can you give it a try and confirm.

@likeich
Copy link
Contributor Author

likeich commented May 26, 2022

@m4gr3d It looks like it's working now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants