wasabeef/android-gpuimage · critical · IllegalArgumentException

No configs match configSpec

Error message

No configs match configSpec

What it means

eglChooseConfig succeeded but returned zero matching framebuffer configurations for mConfigSpec, so the ConfigChooser throws. The requested surface configuration (color/stencil/depth bits) cannot be satisfied by any EGLConfig on this device.

Solutions

  1. Relax the config spec: drop EGL_STENCIL_SIZE and reduce depth/alpha bit requirements
  2. Add a fallback chooser that retries with EGL_DONT_CARE bits
  3. Check EGLConfig listing via eglGetConfigs to see what the device actually offers
  4. Use TextureView/SurfaceView with hardware acceleration enabled

Example fix

// before
spec: { EGL_RED_SIZE 8, GREEN 8, BLUE 8, ALPHA 8, DEPTH 24, STENCIL 8, ... }
// after
if (numConfigs <= 0) {
    int[] relaxed = { EGL10.EGL_DEPTH_SIZE, 16, EGL10.EGL_NONE };
    egl.eglChooseConfig(display, relaxed, null, 0, num_config);
}
Defensive patterns

Strategy: fallback

Validate before calling

int[] num = new int[1];
if (!egl.eglChooseConfig(display, spec, null, 0, num) || num[0] <= 0) {
    spec = new int[]{ EGL10.EGL_DEPTH_SIZE, 16, EGL10.EGL_NONE }; // relaxed fallback
}

Try / catch

// catch (IllegalArgumentException e) { recreate view with relaxed config or RGB565 }

Prevention

When it happens

Trigger: mConfigSpec demands a combination no device config satisfies (e.g. specific RGB bit sizes plus stencil), producing numConfigs <= 0 after a successful eglChooseConfig call.

Common situations: Very old or exotic GPUs, emulators with software rendering, devices where the exact 8-8-8-8 RGBA + depth24/stencil8 combination is unavailable.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of wasabeef/android-gpuimage@ceea576ec9 (2026-09-11). Data as JSON: /api/errors/63e1d069f08aaec1. Report an issue: GitHub.

Appendix: source

Thrown at library/src/main/java/jp/co/cyberagent/android/gpuimage/GLTextureView.java:783

         */
        EGLConfig chooseConfig(EGL10 egl, EGLDisplay display);
    }

    private abstract class BaseConfigChooser implements EGLConfigChooser {
        public BaseConfigChooser(int[] configSpec) {
            mConfigSpec = filterConfigSpec(configSpec);
        }

        public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
            int[] num_config = new int[1];
            if (!egl.eglChooseConfig(display, mConfigSpec, null, 0, num_config)) {
                throw new IllegalArgumentException("eglChooseConfig failed");
            }

            int numConfigs = num_config[0];

            if (numConfigs <= 0) {
                throw new IllegalArgumentException("No configs match configSpec");
            }

            EGLConfig[] configs = new EGLConfig[numConfigs];
            if (!egl.eglChooseConfig(display, mConfigSpec, configs, numConfigs, num_config)) {
                throw new IllegalArgumentException("eglChooseConfig#2 failed");
            }
            EGLConfig config = chooseConfig(egl, display, configs);
            if (config == null) {
                throw new IllegalArgumentException("No config chosen");
            }
            return config;
        }

        abstract EGLConfig chooseConfig(EGL10 egl, EGLDisplay display, EGLConfig[] configs);

        protected int[] mConfigSpec;

        private int[] filterConfigSpec(int[] configSpec) {

View on GitHub (pinned to ceea576ec9)