Fixed
Status Update
Comments
[Deleted User] <[Deleted User]> #2
Please upgrade to Fragment 1.3.2 and include a sample project that reproduces your issue.
jb...@google.com <jb...@google.com> #3
I updated Fragment to 1.3.2, but I still get this crash.
[Deleted User] <[Deleted User]> #4
I can confirm it with Firebase Crashlytics, but I do not know the condition of occurrence yet, and there is no sample project yet.
ap...@google.com <ap...@google.com> #5
Having plenty of such crashes with fragment 1.3.3
ap...@google.com <ap...@google.com> #6
Not exactly, but quite similar
```
java.lang.NullPointerException: Attempt to invoke virtual method 'float android.view.View.getAlpha()' on a null object reference
at androidx.fragment.app.SpecialEffectsController$Operation$State.from(SpecialEffectsController$Operation.java:409)
at androidx.fragment.app.SpecialEffectsController.markPostponedState(SpecialEffectsController.java:236)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2201)
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:873)
```
```
java.lang.NullPointerException: Attempt to invoke virtual method 'float android.view.View.getAlpha()' on a null object reference
at androidx.fragment.app.SpecialEffectsController$Operation$State.from(SpecialEffectsController$Operation.java:409)
at androidx.fragment.app.SpecialEffectsController.markPostponedState(SpecialEffectsController.java:236)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2201)
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:873)
```
ap...@google.com <ap...@google.com> #7
Re #5 - if you have a sample project that reproduces this issue, we'd be happy to take a look.
ap...@google.com <ap...@google.com> #8
I've never been able to reproduce this crash myself, just observing crashlytics reports for our company's app
ap...@google.com <ap...@google.com> #9
I suspect this could be related to removing hidden fragment (i.e. tx.hide(fragment)) in a started state (onPause was called). We also have Slide exit transition on it
ap...@google.com <ap...@google.com> #10
We're seeing this a fair amount, on Android 9, 10, and 11, across a broad spectrum of devices. The ratio of users to events is only about 2:3, so this isn't something that seems tied to specific devices or user behaviors. No luck reproducing it so far. And with our own code nowhere in the stack, we have no clear way to protect against this crash.
Looking at BugSnag breadcrumbs, the crash always occurs immediately after a Fragment is destroyed. Not always the same fragment... I'm seeing a variety of fragments, which I suspect correspond to our most-used features.
Timing of the earliest occurrences of this crash seem to line up with our having upgraded androidx.fragment:fragment-ktx from 1.2.5 to 1.3.3, but I have no strong evidence this is the cause.
Looking at BugSnag breadcrumbs, the crash always occurs immediately after a Fragment is destroyed. Not always the same fragment... I'm seeing a variety of fragments, which I suspect correspond to our most-used features.
Timing of the earliest occurrences of this crash seem to line up with our having upgraded androidx.fragment:fragment-ktx from 1.2.5 to 1.3.3, but I have no strong evidence this is the cause.
jb...@google.com <jb...@google.com> #11
the crash is also gone with FragmentManager.enableNewStateManager(false)
vi...@gmail.com <vi...@gmail.com> #12
Thank you, I'll try it.
il...@google.com <il...@google.com> #13
Calling FragmentManager.enableNewStateManager(false) eliminates this crash for me. But I'm not sure what risks or loss of functionality come with making that call. I would of course prefer this NullPointerException weren't being thrown.
Description
Version used:2.2.0-alpha02
Devices/Android versions reproduced on: All
If this is a bug in the library, we would appreciate if you could attach:
- Sample project to trigger the issue.
2019-09-09 12:57:19.033 27253-27253/com.example.android.motion E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.android.motion, PID: 27253
java.lang.ClassCastException: androidx.transition.TransitionSet cannot be cast to android.transition.Transition
at androidx.fragment.app.FragmentTransition.setListenerForTransitionEnd(FragmentTransition.java:307)
at androidx.fragment.app.FragmentTransition.configureTransitionsReordered(FragmentTransition.java:258)
at androidx.fragment.app.FragmentTransition.startTransitions(FragmentTransition.java:136)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2385)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2333)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2230)
at androidx.fragment.app.FragmentManager$3.run(FragmentManager.java:414)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7037)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
Works fine with alpha01.
Have a nice day !