question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android 12L - AbstractMethodError calling onSpatializerAvailableChanged

See original GitHub issue

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 bugreport to dev.exoplayer@gmail.com after filing this issue.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:23 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
toniheicommented, Oct 22, 2022

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.

0reactions
zgzongcommented, Nov 9, 2022

@christosts Thanks for sharing the detail about how to test spatial audio.

On the other side, we met same lint error in the android studio which has been reported to google issuetracker already here https://issuetracker.google.com/issues/234009300

Read more comments on GitHub >

github_iconTop Results From Across the Web

AbstractMethodError - Android Developers
Thrown when an application tries to call an abstract method. Normally, this error is caught by the compiler; this error can only occur...
Read more >
java.lang.AbstractMethodError: abstract method not ...
I've tried this on both android 2.3.3 and android 4.0.3 emulators and it worked. Note that I've removed the @Override annotation.
Read more >
せつ(技術垢) (@lsetzl_it) / Twitter
Android 12L - AbstractMethodError calling onSpatializerAvailableChanged · Issue #10684 · google/E... ExoPlayer Version 2.18.0 Devices that reproduce the ...
Read more >
AbstractMethodError when calling interface provided as Java ...
I'm getting a java.lang.AbstractMethodError at runtime after updating to Android Gradle Plugin 3.4.1 (from 3.3.2). If I disable R8 via "android.
Read more >
google/ExoPlayer - Issues Antenna
Android 12L - AbstractMethodError calling onSpatializerAvailableChanged. 000. ExoPlayer Version 2.18.0 Devices that reproduce the issue All devices that ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found