Issue
There are a few other questions like this but all refer to Android Support library. I'm using the new androidx libraries instead.
After updating the androidx lifecycle dependency from 2.2.0-alpha03 to 2.2.0-alpha04, I get the following crash (on Android 9):
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.myapp, PID: 12345
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.configureTransitionsOrdered(FragmentTransition.java:419)
at androidx.fragment.app.FragmentTransition.startTransitions(FragmentTransition.java:139)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2383)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2341)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2244)
at androidx.fragment.app.FragmentManager$3.run(FragmentManager.java:422)
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)
Same problem with version 2.2.0-alpha05.
UPDATE: actually, it seems that androidx fragment 1.2.0-alpha03 is being pulled in, and that is causing the problem. When using fragment 1.2.0-alpha02, the crash does not occur. The problematic cast is added here:
This crash happens after calling:
supportFragmentManager
.beginTransaction()
.remove(f)
.commit()
And the only workaround I've found is to remove the exit transition:
f.exitTransition = Slide(gravity)
Note, the fragment f is of type: androidx.fragment.app.Fragment
Any ideas?
Solution
This issue has been fixed in the upcoming Fragment 1.2.0-beta01 release.
See the bug here: https://issuetracker.google.com/issues/142056487
Answered By - jeremybwoods
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.