androidx / androidx/media

Unable to surface error messages in Android Auto when onGetChildren fails

Open
#2,901 16 comments 2 reactions 1 assignee View on GitHub

@marcbaechinger is already working on this.

Since Nov 19, 2025.

bug
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
  1. Returning different SessionError types:

    LibraryResult.ofError(SessionError.ERROR_UNKNOWN)
    
  2. Returning a SessionError with a custom message:

    LibraryResult.ofError(SessionError(SessionError.ERROR_UNKNOWN, "Something went wrong"))
    
  3. Sending an error separately:

    val error = SessionError(
        SessionError.ERROR_SESSION_AUTHENTICATION_EXPIRED,
        "Error message"
    )
    session.sendError(browser, error)
    
  4. Using LibraryParams with 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.