-
-
Notifications
You must be signed in to change notification settings - Fork 514
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
[3.7.0] Android change broke with appcompat >= 1.3.x and detachPreviousScreen #1122
Comments
I managed to reproduce the freeze. It seems like a change in the behavior of
|
@WoLewicki I had actually solved the issue by forcing androidx compat to 1.1 (the default one provided by RN?), but didn't think about only requiring for the fragment one. I will give it a try later today and reply back. However, as we migrate closer to Android 12 (will be released shortly, and most apps will be forced to upgrade to SDK 31 due to some extremely ugly splash screen changes), this issue will need to be fixed eventually. Are the fragment changes that big? |
@WoLewicki forcing androidx fragment version does fix the issue too. However, if we also require to define |
@WoLewicki after further testing, forcing fragment 1.2.1 (or any in the 1.2.x series) breaks screens that use surfaces (only with screens 3.7.x). For instance, react-native-camera ends up stopping and restarting the camera when the screen that has a camera component unmounts. I have traced this to some odd behaviour that causes the screen texture (TextureView). You can see the behaviour in the following videos, basically, the camera becomes nearly unusable because it stops and starts while the screen pop animation happens, making it very slow and freezing the UI. With fragment 1.2.1 With fragment 1.3.x Any ideas on what could it be? This is game breaking for us. Note that there are no issues on screen pushes (surface is destroyed after the animation happens, instead of being destroyed and recreated in order to do the pop animation) |
I have no knowledge of the internals of the |
For the long term, supporting the updated fragment versions I guess would be ideal, but for now I have no problem with forcing fragments 1.2 in order for the library to work. However, with fragment 1.2 the issue of surfaces getting recreated when popping starts to happen. Would it be easier to debug what’s wrong with the 1.2 implementation as opposed to to trying to support fragment 1.3? Keep in mind this means that the recommended setup will cause issues to anyone using react native camera or any library that uses texture surfaces to draw content. I will try to do some debugging, but debugging android native is not really my strong. |
You can rather quickly check the changes here: https://developer.android.com/jetpack/androidx/releases/fragment#1.2.1. Does this issue appear if you use the |
@WoLewicki I have tried all version combinations, and the surface being re-created when popping happens with any version below fragment/appcompat < 1.3, and it was not introduced in 3.7, as I found it also happens with 3.6. So, in conclusion, looks like I've been using appcompat and fragment 1.3.x for a while (with screens ever since 3.x), and never had issues. Then, when upgrading to 3.7, the stuck screens issue appeared due to the use of fragment 1.3, so I ended up going back to appcompat and fragment 1.1 and 1.2, but then this brought back, a possibly old bug, that makes texture surfaces to be re-created when popping a screen and breaking anything that relies on it (e.g., react native camera). I guess I will stick with appcompat 1.3 so texture surfaces continue to work as before, and just stay away from Just to add a bit more, the issue with texture views comes from using them as recommended by android here https://developer.android.com/reference/android/view/TextureView . Basically, popping a screen causes |
Hmm, and what is your use-case for |
I'm using So without |
Ok, let me know if you find out anything concerning the behavior in newer versions. I will also try and debug it a little in the free time, but I guess it won't be easy to apply changes to the code such that it works correctly for all versions of |
I think I found the reason for the issue. It is described in PR: #1133. Can you check if it fixes your issue and does not introduce any new ones? |
@WoLewicki you're awesome! I will test shortly and let you know. |
I also use |
Description
#1066 introduced a bug that causes inactive screen to end up stuck when
detachPreviousScreen
is used alongsideandroidx.appcompat:appcompat
1.3.1 or above. The issue does not happen when using the outdated 1.1.0 version.Screenshots
Steps To Reproduce
Force a compat version greater than 1.1, e.g.,
Use stack navigator with
detachPreviousScreen
, e.g.,Run the app and navigate next until the last screen.
Navigate back and observe
Expected behavior
Screen transitioning normally
Actual behavior
Screen stuck
Snack or minimal code example
https://github.com/cristianoccazinsp/react-native-screens/tree/bug-repro
https://github.com/software-mansion/react-native-screens/compare/master...cristianoccazinsp:bug-repro?expand=1
Package versions
The text was updated successfully, but these errors were encountered: