ExoPlayer: Android 12L - AbstractMethodError calling onSpatializerAvailableChanged
ExoPlayer Version
2.18.0
Devices that reproduce the issue
All devices that have this issue are Samsung devices within the Galaxy Z Fold/Flip series, running Android 12 (presumably 12L)
For example, the three most popular devices experiencing this issue are:
- Galaxy Z Flip3 5G
- Galaxy Z Flip4
- Galaxy Z Fold3 5G
Devices that do not reproduce the issue
Non-Galaxy Z Flip/Fold series devices
Reproducible in the demo app?
Not tested
Reproduction steps
We have seen this issue in the wild and unfortunately do not have access to the affected devices to find steps to reproduce this crash.
Based on the crash reports received, it seems 86% of crashes occur when the app is in the background. Due to the nature of foldable devices, this could be perhaps linked to a form config change (i.e. folding/unfolding) or something similar.
Should it help, our player is defined as follows (with some minor code omitted)
// Cache
val cache = SimpleCache(createVideoCacheDir(context),
LeastRecentlyUsedCacheEvictor(VIDEO_CACHE_SIZE.toLong()),
ExoDatabaseProvider(context))
// CacheDataSource
val upstreamFactory: DataSource.Factory = OkHttpDataSourceFactory({ request -> okHttp.newCall(request) }, USER_AGENT)
val cacheDataSource = CacheDataSource.Factory()
.setCache(exoCache)
.setUpstreamDataSourceFactory(upstreamFactory)
.setFlags(CacheDataSource.FLAG_IGNORE_CACHE_ON_ERROR)
// ExoPlayer
ExoPlayer.Builder(context)
.setLooper(Looper.getMainLooper())
.setMediaSourceFactory(DefaultMediaSourceFactory(cacheDataSource))
.setTrackSelector(DefaultTrackSelector(context, AdaptiveTrackSelection.Factory()))
.build()
Expected result
The media plays successfully and backgrounding the app works as expected
Actual result
Exoplayer crashes with the following stacktrace
Fatal Exception: java.lang.AbstractMethodError: abstract method "void android.media.Spatializer$OnSpatializerStateChangedListener.onSpatializerAvailableChanged(android.media.Spatializer, boolean)"
at android.media.Spatializer$SpatializerInfoDispatcherStub.lambda$dispatchSpatializerAvailableChanged$1$Spatializer$SpatializerInfoDispatcherStub(Spatializer.java:529)
at android.media.Spatializer$SpatializerInfoDispatcherStub$$ExternalSyntheticLambda0.run(Spatializer.java:6)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.os.HandlerThread.run(HandlerThread.java:67)
Media
Not applicable
Bug Report
- You will email the zip file produced by
adb bugreportto dev.exoplayer@gmail.com after filing this issue.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 24 (7 by maintainers)
Commits related to this issue
- Enfore minCompileSdk version when depending on ExoPlayer/Media3 libs If an app sets a compileSdkVersion that is lower than the one used to create AARs of its dependencies, the build process may produ... — committed to google/ExoPlayer by tonihei 2 years ago
- Enfore minCompileSdk version when depending on ExoPlayer/Media3 libs If an app sets a compileSdkVersion that is lower than the one used to create AARs of its dependencies, the build process may produ... — committed to androidx/media by tonihei 2 years ago
- Enfore minCompileSdk version when depending on ExoPlayer/Media3 libs If an app sets a compileSdkVersion that is lower than the one used to create AARs of its dependencies, the build process may produ... — committed to androidx/media by tonihei 2 years ago
- Enfore minCompileSdk version when depending on ExoPlayer/Media3 libs If an app sets a compileSdkVersion that is lower than the one used to create AARs of its dependencies, the build process may produ... — committed to google/ExoPlayer by tonihei 2 years ago
- Chore/bump exo 2.18.2 (#66) * Clean up FrameProcessor TODOs. PiperOrigin-RevId: 465044342 (cherry picked from commit 245326a0433c82bf851e2fa556bb8399cf1ba2d6) * Clean up NOP constructor lines ... — committed to DiceTechnology/ExoPlayer by guoen21 2 years ago
Well, we weren’t fully aware of this either until yesterday. 😃
But it definitely seems expected that an app uses at least the compile SDK that all of its dependencies are using. Some dependencies like AndroidX appcompat seem to be able to enforce this automatically, so we’ll try to do the same in the future to avoid the additional documentation need.