Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

BufferQueue has been abandoned usually means your VirtualDisplay is still trying to write frames to a Surface whose consumer—often an ImageReader—has already been closed or disconnected. Fix the lifetime mismatch: stop accepting frame work, release the virtual display, then close the reader and surface, and prevent late callbacks from using the old objects. Also register MediaProjection.Callback before creating the virtual display. On Android 14 and later, treat projection consent and virtual-display creation as single-use for each capture session.

The error is about Android’s screen-capture graphics pipeline. A website screenshot service such as ScreenshotNeo captures web pages and cannot repair an Android app’s BufferQueue lifecycle; an optional web-page capture alternative appears after the Android fix.

What the error means

MediaProjection captures screen content through a VirtualDisplay, which produces frames into a Surface. With an ImageReader pipeline, the reader consumes those frames. Android connects producers and consumers through a BufferQueue. The abandoned-queue message indicates that producer work has reached a queue after its consumer was released or disconnected.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The message commonly appears during teardown or restart: for example, an ImageReader listener or other frame callback runs after the reader has been closed. A single line during shutdown may be a late operation racing with cleanup; Android does not classify such a line as harmless. Repeated messages, black captures, or a resume that fails are reasons to fix lifecycle synchronization rather than ignore the log.

#1 Best Overall
Samsung Galaxy A17 5G Smart Phone 128GB US 1 Yr Manufacturer Warranty Black
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.

Fix the capture lifecycle in this order

  1. Register the stop callback first. Call MediaProjection.registerCallback() before createVirtualDisplay(). Implement onStop() so system-initiated termination follows the same cleanup path as an in-app stop.
  2. Make shutdown idempotent. Use one stop routine for the stop button, projection callback, activity or service destruction, and other termination events. Mark capture as stopping before cleanup so no new frame work begins.
  3. Stop the producer. Release the VirtualDisplay before destroying its output objects. Do not create another virtual display from a projection that has stopped.
  4. Stop and drain consumer work. Disable the ImageReader listener and gate queued callbacks. Close every acquired Image, including on error paths.
  5. Release output resources. Close the ImageReader and release the output Surface after the producer is stopped. Keep one owner responsible for each object.
  6. Serialize restart. Do not allocate a new reader, surface, or display until the previous session’s cleanup has completed. Use a controlled thread, executor, or serialized coroutine for lifecycle operations.

Kotlin teardown pattern

This pattern shows the important ownership and ordering rules for an ImageReader-based capture. It assumes your app has already obtained a valid projection and created the reader, surface, and display. Run lifecycle changes on one controlled thread; if frame callbacks run elsewhere, gate them with the same stopping state or a session-generation token.

private val stopping = AtomicBoolean(false)

private var mediaProjection: MediaProjection? = null
private var virtualDisplay: VirtualDisplay? = null
private var imageReader: ImageReader? = null
private var outputSurface: Surface? = null
private var imageHandler: Handler? = null

private val projectionCallback = object : MediaProjection.Callback() {
    override fun onStop() {
        // The system has stopped this projection. Clean up local objects,
        // but don't call mediaProjection.stop() again from this callback.
        stopCapture(stopProjection = false)
    }
}

private fun startCapture(
    projection: MediaProjection,
    width: Int,
    height: Int,
    densityDpi: Int
) {
    require(width > 0 && height > 0 && densityDpi > 0)
    check(!stopping.get()) { "Previous capture is still stopping" }

    mediaProjection = projection
    projection.registerCallback(projectionCallback, imageHandler)

    val reader = ImageReader.newInstance(
        width, height, PixelFormat.RGBA_8888, 2
    )
    imageReader = reader
    outputSurface = reader.surface

    reader.setOnImageAvailableListener({ source ->
        if (stopping.get()) return@setOnImageAvailableListener
        val image = try {
            source.acquireLatestImage()
        } catch (_: IllegalStateException) {
            null // Reader may have closed while work was being dispatched.
        } ?: return@setOnImageAvailableListener

        try {
            if (!stopping.get()) {
                // Process or copy this frame here. Do not retain Image past close.
            }
        } finally {
            image.close()
        }
    }, imageHandler)

    virtualDisplay = projection.createVirtualDisplay(
        "ScreenCapture",
        width,
        height,
        densityDpi,
        DisplayManager.VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR,
        outputSurface,
        null,
        imageHandler
    )
}

private fun stopCapture(stopProjection: Boolean = true) {
    if (!stopping.compareAndSet(false, true)) return

    imageReader?.setOnImageAvailableListener(null, null)

    virtualDisplay?.release()
    virtualDisplay = null

    imageReader?.close()
    imageReader = null

    outputSurface?.release()
    outputSurface = null

    val projection = mediaProjection
    mediaProjection = null
    if (stopProjection) {
        projection?.unregisterCallback(projectionCallback)
        projection?.stop()
    }
}

Use the exact release sequence appropriate to your ownership model. In particular, avoid multiple stop calls racing on different threads: dispatch both explicit shutdown and callback cleanup through one serialized lifecycle path. Reset the stopping state only as part of starting a genuinely new session with fresh resources, not while callbacks from the prior session may still be pending.

Rank #2
Tracfone Motorola Moto G 2025, 64GB, Saphire Blue (Locked to
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Tracfone plan required, activating is easy, just 3 steps.
  • DISPLAY: Immersive viewing on a 6.7-inch super-bright 120Hz display with powerful stereo speakers and Bass Boost for cinematic entertainment.
  • CAMERA SYSTEM: Advanced 50MP Quad Pixel camera captures sharp, detailed photos and videos in any lighting condition
  • PERFORMANCE: Lightning-fast 5G connectivity paired with a powerful processor and RAM Boost for smooth multitasking.
  • BATTERY LIFE: Long-lasting 5000mAh battery with TurboPower charging technology delivers hours of power in minutes.

Android 14 and later: start a fresh session, not a reused display

Android 14 introduced app-window sharing and stricter projection session rules. One consent session permits one capture start; do not reuse its consent result to create multiple projection instances, and do not call createVirtualDisplay() more than once on one projection instance. A stopped projection cannot create a replacement display. To capture again, obtain consent for a new session and build new capture resources.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If capture runs in a foreground service and your app targets Android 14 or later, configure the mediaProjection foreground-service type. The system can stop a projection when the user ends sharing, the screen locks, another projection takes over, or the owning activity or service is destroyed. Treat onStop() as a normal lifecycle event, not an exceptional edge case.

Rank #3
Samsung Galaxy A17 5G Smart Phone 128GB, US 1 Yr Manufacturer Warranty Blue
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.

Keep display dimensions and output surface aligned

Pass positive width, height, and density values when creating the virtual display, and configure the output surface for the intended frame dimensions. If the capture size changes, update the virtual display and surface together; changing only one can produce incorrect sizing or aspect ratio. Ensure that dimension updates and teardown are serialized so a resize cannot target a display being released.

Handle acquired images without exhausting the queue

ImageReader has a finite image queue. Every Image returned by acquireNextImage() or acquireLatestImage() must be closed, including when frame conversion throws or the callback decides to discard it. A try/finally around processing is the simplest safeguard. If frame processing is slower than capture, acquire the latest frame when older frames are not useful, and avoid retaining images while asynchronous work runs.

Rank #4
Samsung Galaxy S26 Ultra, Unlocked Android Smartphone, 512GB, Black
  • PRIVACY DISPLAY: Automatically hide your screen from those beside you. The built-in privacy display can be preset¹ to turn on when receiving notifications, typing passwords, or using specific apps
  • TYPE IT IN. TRANSFORM IT FAST: Enhance any shot in seconds on your smartphone by using Photo Assist² with Galaxy AI.³ Add objects, restore details, or apply new styles by simply typing or tapping
  • NIGHTS, CAPTURED CLEARLY: From gigs to city lights, record and capture moments after dark with clarity using Nightography so your photos and videos stay crisp and clear on your Samsung Galaxy
  • MAKE IT. EDIT IT. SHARE IT: Turn everyday moments into something personal with creative tools built right into your mobile phone, whether it’s a special contact photo, custom wallpaper, an invitation or more⁴
  • HELP THAT KEEPS UP: Stay in the moment while Now Nudge with Galaxy AI helps you respond faster and stay organized with smart suggestions⁵ that appear exactly when you need them on your phone

Also avoid a callback that continues scheduling new work after shutdown begins. Removing the listener prevents future notifications but does not retroactively cancel work already queued. Check a stopping flag or session-generation token immediately before touching resources and before publishing processed results.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting symptoms

Symptom Likely lifecycle issue What to check
Abandoned-queue log only while stopping A queued producer operation or callback raced with teardown. Confirm the listener is disabled, the display is released before consumer resources, and queued work checks the stopping state.
Repeated errors after stop or restart The old session is still active in a callback, or cleanup is happening more than once concurrently. Use a single idempotent shutdown path and ensure restart waits until it completes.
Black or missing frames The display may be writing to a released, incorrectly sized, or no-longer-owned surface. Check that the surface remains valid during capture, dimensions are positive and consistent, and the projection has not stopped.
Capture will not resume on Android 14+ The app may be trying to reuse a stopped projection or an already-used consent session. Start a new consent session and create a fresh projection and virtual display.
ImageReader queue stalls or acquisition fails Images may not be closed promptly, or callbacks may still target a closed reader. Close each acquired image in finally, disable callbacks, and reject stale session work.

Common implementation mistakes

  • Registering the callback after display creation: register it before createVirtualDisplay() so termination is observed across the session lifecycle.
  • Closing the reader before stopping the display: the producer can still write to the consumer’s queue. Release the virtual display first.
  • Stopping only from the activity button: the system can end projection without that button being used. Route onStop() through cleanup.
  • Calling stop from several owners: a service, activity, and callback can otherwise race. Centralize ownership and make cleanup idempotent.
  • Reusing old resources: a new capture should not inherit a previous session’s surface, reader, or stopped projection.

Or skip the browser setup

ScreenshotNeo is for capturing web pages, not Android MediaProjection frames, so it is not a fix for BufferQueue has been abandoned. If your real task is a clean website screenshot rather than Android device capture, its API provides a one-request alternative:

Best Value
Tracfone Moto g Play 2024 Prepaid Phone with a 1-Yr Plan Included
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Activating is easy, just 3 steps.
  • ACTIVATION Promotion: Includes 1500 min, 1500 texts & 1500 MB Data + add more as you need it
  • CAMERA SYSTEM: 50MP Quad Pixel camera. Capture sharper, more vibrant photos day or night with 4x the light sensitivity.
  • PERFORMANCE: Blazing-fast Qualcomm performance. Get the speed you need for great entertainment with a Snapdragon 680 processor and 4GB of RAM.
  • 64GB built-in storage. Get plenty of room for photos, movies, songs, and apps. Made for US
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation. Its capture flow can accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets before taking the shot; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The Free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to try website captures; it does not replace the Android lifecycle fix above.

Frequently Asked Questions

Does the log by itself prove that MediaProjection consent was denied?

No. This message describes a producer writing to an abandoned graphics queue; it is not, by itself, evidence about whether the user granted consent.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Is this the same as an Android permission error?

No. Permission and consent determine whether capture can start; this error concerns the lifetime of the frame producer and consumer after they are connected.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.