R8 FullMode Debug throwing Transition XXX is not a valid framework Transition or AndroidX Transition

Viewed 996

With android.enableR8.fullMode=true and minifyEnabled true on Debug builds we are seeing the following runtime error (multiple devices and the emulator):

Fatal Exception: java.lang.IllegalArgumentException: Transition Slide@b15f5f5: dur(400) for fragment MyFragment is not a valid framework Transition or AndroidX Transition

On a Release build it doesn't happen (with R8 FullMode on)

If I turn R8 FullMode off we don't see the error on the Debug build

import androidx.transition.TransitionInflater

abstract class MyBaseFragment : Fragment() {
  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    enterTransition = TransitionInflater.from(requireContext()).inflateTransition(R.transition.slide_right)
  }
}

slide_right.xml:

<slide xmlns:android="http://schemas.android.com/apk/res/android"
  android:duration="@android:integer/config_mediumAnimTime"
  android:slideEdge="right" />

proguard-rules.pro (snippet):

-keep class **.R
-keep class **.R$* {
   <fields>;
}
-keepclassmembers class **.R$* {
   public static <fields>;
}

Anyone have any clue why R8 FullMode would do this on debug builds? Are there any additional proguard rules that might need to be added in this case?

1 Answers
Related