Describe the bug
When opening an .m4a attachment in the Stream Chat SDK’s AttachmentMediaActivity, the app crashes with an InflateException and a ClassCastException.
The crash occurs because androidx.media3.ui.PlayerView attempts to cast com.google.android.exoplayer2.ui.AspectRatioFrameLayout (from the old ExoPlayer package) to androidx.media3.ui.AspectRatioFrameLayout.
This indicates a dependency conflict between the legacy ExoPlayer (com.google.android.exoplayer2) and Media3 (androidx.media3) libraries used internally by the SDK.
Caused by: java.lang.ClassCastException: com.google.android.exoplayer2.ui.AspectRatioFrameLayout cannot be cast to androidx.media3.ui.AspectRatioFrameLayout
SDK version
To Reproduce
Steps to reproduce the behavior:
- Launch the chat and open a message with an .m4a audio attachment or upload any m4a file in the chat message.
- Tap on the audio to open the gallery/media viewer (AttachmentMediaActivity).
- The app crashes during layout inflation of stream_ui_activity_attachment_media.
Expected behavior
The media viewer should open and play the .m4a audio file normally without crashing.
Device:
Vendor and model: Samsung Galaxy A52, Google Pixel 8a
Android version: Android 14, Android 15