{"record":{"id":"39cf389455d3c182","repo":"wasabeef/android-gpuimage","slug":"no-config-chosen","errorCode":null,"errorMessage":"No config chosen","messagePattern":"No config chosen","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"library/src/main/java/jp/co/cyberagent/android/gpuimage/GLTextureView.java","lineNumber":792,"sourceCode":"        public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {\n            int[] num_config = new int[1];\n            if (!egl.eglChooseConfig(display, mConfigSpec, null, 0, num_config)) {\n                throw new IllegalArgumentException(\"eglChooseConfig failed\");\n            }\n\n            int numConfigs = num_config[0];\n\n            if (numConfigs <= 0) {\n                throw new IllegalArgumentException(\"No configs match configSpec\");\n            }\n\n            EGLConfig[] configs = new EGLConfig[numConfigs];\n            if (!egl.eglChooseConfig(display, mConfigSpec, configs, numConfigs, num_config)) {\n                throw new IllegalArgumentException(\"eglChooseConfig#2 failed\");\n            }\n            EGLConfig config = chooseConfig(egl, display, configs);\n            if (config == null) {\n                throw new IllegalArgumentException(\"No config chosen\");\n            }\n            return config;\n        }\n\n        abstract EGLConfig chooseConfig(EGL10 egl, EGLDisplay display, EGLConfig[] configs);\n\n        protected int[] mConfigSpec;\n\n        private int[] filterConfigSpec(int[] configSpec) {\n            if (eglContextClientVersion != 2) {\n                return configSpec;\n            }\n            /* We know none of the subclasses define EGL_RENDERABLE_TYPE.\n             * And we know the configSpec is well formed.\n             */\n            int len = configSpec.length;\n            int[] newConfigSpec = new int[len + 2];\n            System.arraycopy(configSpec, 0, newConfigSpec, 0, len - 1);","sourceCodeStart":774,"sourceCodeEnd":810,"githubUrl":"https://github.com/wasabeef/android-gpuimage/blob/ceea576ec931c2968431ad46f1fb2e6d68a542e2/library/src/main/java/jp/co/cyberagent/android/gpuimage/GLTextureView.java#L774-L810","documentation":"All returned EGLConfigs were inspected by chooseConfig(egl, display, configs) and none matched the ComponentSizeChooser's criteria (RGB bit sizes / alpha / depth), so it returned null. Unlike errors 1-2, EGL worked; the device's configs simply don't pass the chooser's filter.","triggerScenarios":"Device reports configs whose red/green/blue/alpha sizes differ from the requested values (e.g. 5-6-5 RGB instead of 8-8-8) while the spec only set minimum desired sizes loosely.","commonSituations":"Low-end devices with RGB565-only surfaces, emulators in software GL mode, headerless devices where alpha isn't supported.","solutions":["Relax ComponentSizeChooser matching (use >= comparisons or EGL_DONT_CARE for non-essential sizes)","Fall back to the first returned EGLConfig instead of throwing","Accept RGB565 as fallback: set requested bits to 5/6/5 on constrained devices","Verify with eglGetConfigs what bit depths the device actually exposes"],"exampleFix":"// before\nif (config == null) throw new IllegalArgumentException(\"No config chosen\");\n// after\nif (config == null && configs.length > 0) {\n    config = configs[0]; // best-effort fallback\n} else if (config == null) { throw ...; }","handlingStrategy":"fallback","validationCode":"// Pre-check chooser criteria against real configs\nEGLConfig[] configs = new EGLConfig[numConfigs];\n// after fill: if (chooseConfig(...) == null) accept configs[0];","typeGuard":null,"tryCatchPattern":"// catch (IllegalArgumentException e) { switch chooser to 'first available config' mode and retry }","preventionTips":["Make ComponentSizeChooser use >= matching with EGL_DONT_CARE for optional sizes","Test on RGB565-only devices","Never assume 8888 RGBA is available"],"tags":["egl","android","opengl","config-selection","device-compatibility"],"backgroundTag":"empty-result-set","analyzedSha":"ceea576ec931c2968431ad46f1fb2e6d68a542e2","analyzedAt":"2026-09-11T16:56:13.742Z","contentChangedAt":"2026-09-11T16:56:13.742Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}