Unable to surface error messages in Android Auto when onGetChildren fails
@marcbaechinger is already working on this.
Since Nov 19, 2025.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
I'm adding Android Auto support to a Media3-based audio library and need to surface errors to users when browsing fails in onGetChildren (for example, due to network or authentication problems).
However, any time onGetChildren() returns LibraryResult.ofError(), Android Auto displays only “No items”. I haven’t found a way to show a meaningful error message.
What I’ve tried
-
Returning different
SessionErrortypes:LibraryResult.ofError(SessionError.ERROR_UNKNOWN) -
Returning a
SessionErrorwith a custom message:LibraryResult.ofError(SessionError(SessionError.ERROR_UNKNOWN, "Something went wrong")) -
Sending an error separately:
val error = SessionError( SessionError.ERROR_SESSION_AUTHENTICATION_EXPIRED, "Error message" ) session.sendError(browser, error) -
Using
LibraryParamswith extras:val errorExtras = Bundle().apply { putString( MediaConstants.EXTRAS_KEY_ERROR_RESOLUTION_ACTION_LABEL_COMPAT, "Error" ) } val errorParams = LibraryParams.Builder() .setExtras(errorExtras) .build() LibraryResult.ofError(error, errorParams)
None of these approaches result in Android Auto showing the provided error message. The UI always falls back to “No items”.
Question
How can an app display a custom error message in Android Auto when a browse operation fails in onGetChildren? Is this currently supported in Media3, and if so, what is the correct mechanism? Apps like Spotify appear to show error messages when browsing fails, so I’m assuming there must be a supported path.
Environment
- Media3: 1.8.0 / 1.9.0-alpha01
- Device: Pixel 6a (API 36.0)
- Android Auto: 15.5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.