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

[Android] White screen on keyboard - issue Long standing problem persist #910

Open
Jai931 opened this issue Jan 3, 2024 · 8 comments
Open
Labels
android This issue is specific to the Android Platform. bug This issue refers to a bug in the plugin Flutter issue/bug Problem caused by Flutte that we can't fix

Comments

@Jai931
Copy link

Jai931 commented Jan 3, 2024

Describe the bug
I am using this widget in my project which required combination of unity and flutter. A white screens appears when keyboard is launched, causing the screen to freeze and to make app work normal need to kill the app.This persistent issue has been impacting app users. We tried useAndroidViewSurface to set true and also false. it is not working to solve this issue. As its blocking app flow. Could you please help me to solve this problem .it is happening randomly sometime working sometime won't.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Manage Password
  2. Click on Textfield Keyboard would appear
  3. White screen visible and app got freezed
  4. need to kill the app to disappear white screen

Expected behavior
Whit screen should not appear. it should work as expected.

Screenshots
I am attaching screenshot and video for reference

video_20240103_135218_edit.1.mp4

MicrosoftTeams-image (5)

Unity (please complete the following information):

  • OS: Android
  • Version 2021.3.11f1

Smartphone (please complete the following information):

  • Device: iqoo
  • OS: funtouch
  • Version 13

Additional context
-- https://github.com/juicycleff/flutter-unity-view-widget/tree/master/android/src/main/kotlin/com/xraph/plugin/flutter_unity_widget
this is the version of widget, I am using. Your quick support would highly appreciated

@timbotimbo
Copy link
Collaborator

timbotimbo commented Jan 3, 2024

Just to confirm, the keyboard is triggered by a textfield inside unity?

Which flutter version are you using?

Can you replicate this while debugging and do you see any errors in the console or using logcat?

@timbotimbo timbotimbo changed the title [Android] White screen issue Long standing problem persist [Android] White screen on keyboard - issue Long standing problem persist Jan 3, 2024
@Jai931
Copy link
Author

Jai931 commented Jan 3, 2024

Hi @timbotimbo
Flutter version - 3.3.10
and i am getting following error when white screen appears
Screenshot 2024-01-03 at 5 41 14 PM

Yes, keyboard is triggered from Unity. I tried from flutter side also for textfield . getting same white screen issue.

@Jai931
Copy link
Author

Jai931 commented Jan 5, 2024

@timbotimbo Any update?

@timbotimbo
Copy link
Collaborator

I can reproduce this with useAndroidViewSurface set to false, but not with it set to true.

  • Windows 10
  • Samsung Galaxy S20FE, Android 13
  • Flutter 3.13.9
  • Unity 2021.3.31

I added an input field to the example project:

useAndroidViewSurface: false (virtual display) useAndroidViewSurface: true (hybrid composition)
Screen_Recording_20240107_223025.mp4
Screen_Recording_20240107_223216.mp4

This looks like a Flutter bug that i've seen before on app resume.
I don't think this is anything that can be fixed in the plugin, I will see if I can report a bug with flutter.

Sorry to say, but don't expect this to be fixed soon.

@timbotimbo timbotimbo added bug This issue refers to a bug in the plugin android This issue is specific to the Android Platform. Flutter issue/bug Problem caused by Flutte that we can't fix labels Jan 7, 2024
@Jai931
Copy link
Author

Jai931 commented Jan 10, 2024

Hi @timbotimbo thanks for your valuable reply and sorry for being late to reply you back. I tried with useAndroidViewSurface true. But it is not working, maybe because of the flutter version difference. If you find any solution for it please let me know because it is on high priority issue and rest of the things is working fine using this library. I am looking forward for you support.

@Jai931
Copy link
Author

Jai931 commented Feb 5, 2024

HI @timbotimbo Any update about the fix?

@timbotimbo
Copy link
Collaborator

timbotimbo commented Feb 16, 2024

As mentioned above

Sorry to say, but don't expect this to be fixed soon.

This is a Flutter bug, and we can't really influence that.

There are some changes in the Flutter github but those haven't helped:

  • Keyboard on flutter 3.19 now breaks the UnityWidget
  • Flutter 3.20 beta resolves your issue, but Unity now resizes to the wrong size when keyboard opens.

@timbotimbo
Copy link
Collaborator

@Jai931
if all your textfields are in the top part of the screen, you might be able to use resizeToAvoidBottomInset: false in a Flutter Scaffold.
Flutter won't resize the body and widget when the keyboard opens and will avoid any of these glitches.
The only thing is that the keyboard might overlap something visible on screen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android This issue is specific to the Android Platform. bug This issue refers to a bug in the plugin Flutter issue/bug Problem caused by Flutte that we can't fix
Projects
None yet
Development

No branches or pull requests

2 participants