androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
https://developer.android.com/media/media3
Apache License 2.0
1.73k stars 415 forks source link

Two Android app instance getting created after upgrade to Media3 v1.4.1 from v1.3.1 #1910

Closed amitpremi-zee closed 3 days ago

amitpremi-zee commented 4 days ago

In our Android app, we are using Media3 v1.3.1 for video playback of live and VOD content, with support for Picture-in-Picture (PIP) mode. We initialize the Media3 ExoPlayer at the app launch itself.

Our app consists of multiple activities, with MainActivity being used for approximately 95% of use cases. We also support deep links and app links in our app, with android:launchMode="singleTask" defined for MainActivity.

After upgrading to Media3 v1.4.1, we noticed that two instances of the app are being created. However, when we downgrade back to Media3 v1.3.1, the issue no longer occurs.

Could you clarify if this is a known change introduced in Media3 v1.4.1 or if this behavior is expected? If not, is this a bug, and how can we fix the issue?

We urgently need to upgrade to Media3 v1.4.1 to address critical DAI stream issues, so any assistance would be highly appreciated.

icbaker commented 4 days ago

This doesn't sound directly related to media3 - it sounds like an interaction between your app and the OS.

My only guess about why you're seeing a difference between 1.3.1 and 1.4.1 is due to a transitive dependency changing something in the way you configure your activity or similar.

I'm afraid we are not experts on android:launchMode or similar config, so not really in a position to help you in detail.

I suggest you diff the transitive deps of your app between depending on media3 1.3.1 and 1.4.1, see if there's any change there that looks plausible, and try bumping only that dep (while keeping media3 1.3.1). If that allows you to repro the issue then you have a good place to keep digging I think.

amitpremi-zee commented 3 days ago

Thanks @icbaker, I found the root cause of the problem, after comparing the merged manifest files. Actually with media3 version change from v1.3.1 to 1.4.1, internally IMA SDK update has also happened from v3.31.0 to v3.33.0. And in IMA SDK v3.33.0, they have introduced below android:taskAffinity="" in AndroidManifest file, that is the problem of 2 app instance.

Thanks Again for the support 😊.