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: Crash related to fragments #13399

Open
1 task done
hansemannn opened this issue Apr 15, 2022 · 2 comments
Open
1 task done

Android: Crash related to fragments #13399

hansemannn opened this issue Apr 15, 2022 · 2 comments
Labels
android bug needs triage This issue hasn't been reviewed by maintainers

Comments

@hansemannn
Copy link
Collaborator

hansemannn commented Apr 15, 2022

I have searched and made sure there are no existing issues for the issue I am filing

  • I have searched the existing issues

Description

This is a follow-up on #12524 which unfortunately is not fully fixed, yet. We still get some crashes:

java.lang.IllegalArgumentException: 
  at androidx.fragment.app.FragmentStateManager.createView (FragmentStateManager.java:513)
  at androidx.fragment.app.FragmentStateManager.moveToExpectedState (FragmentStateManager.java:282)
  at androidx.fragment.app.FragmentManager.executeOpsTogether (FragmentManager.java:2189)
  at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute (FragmentManager.java:2100)
  at androidx.fragment.app.FragmentManager.execPendingActions (FragmentManager.java:2002)
  at androidx.fragment.app.FragmentManager$5.run (FragmentManager.java:524)
  at android.os.Handler.handleCallback (Handler.java:808)
  at android.os.Handler.dispatchMessage (Handler.java:101)
  at android.os.Looper.loop (Looper.java:166)
  at android.app.ActivityThread.main (ActivityThread.java:7529)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:245)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:921)

A similar crash was reported for RN as well: software-mansion/react-native-screens#463 and it seems like it could be something related to the "FragmentTransaction" class and how it is reused (which would make sense in a ListView context). And they seem to have fixed it in https://github.com/software-mansion/react-native-screens/pull/1006/files which looks like a doable change (reuse the transaction, change the Runnable usage).

More possible fixes:

Happy to sponsor any work on this fix again!

Expected Behavior

The app should not crash.

Actual behavior

The app should does crash.

Reproducible sample

See #13243

Steps to reproduce

See #13243

Platform

Android

SDK version you are using

10.2.0

Alloy version you are using

No response

@m1ga
Copy link
Contributor

m1ga commented Apr 16, 2022

I wonder if the reordering already helps. I've added a test PR so you can try the actifacts #13400

Can you reproduce the crash all the time? Since the example still works fine here with the current 10.2.0

@hansemannn
Copy link
Collaborator Author

hansemannn commented Apr 16, 2022

We just ordered a Xiaomi device to reproduce it (to be delivered by Wednesday). Your PR changes many parts, so I'm not sure if I can properly identify possible regressions. And I was just able to reproduce it, the error was:

[DEBUG] MapsInitializer: preferredRenderer: null
[DEBUG] zzca: preferredRenderer: null
[INFO]  I/Google Maps Android API: Google Play services package version: 201817019
[ERROR] E/io.lambus.app: Invalid ID 0x00000005.
[DEBUG] AndroidRuntime: Shutting down VM
[INFO]  I/com.example.myapp: WaitForGcToComplete blo

before moving to an ANR. And I assume the "invalid ID" is the ID of the fragment, which is recycled too fast when updating the list view too fast. I added a "debouncer" now, but you can reproduce it in our tr****n-v2 branch :)

@m1ga m1ga added the android label Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android bug needs triage This issue hasn't been reviewed by maintainers
Projects
None yet
Development

No branches or pull requests

2 participants