{"record":{"id":"b731e62c0a871c40","repo":"wasabeef/android-gpuimage","slug":"eglconfig-not-initialized","errorCode":null,"errorMessage":"eglConfig not initialized","messagePattern":"eglConfig not initialized","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"library/src/main/java/jp/co/cyberagent/android/gpuimage/GLTextureView.java","lineNumber":968,"sourceCode":"         * already exists, destroy it before creating the new surface.\n         *\n         * @return true if the surface was created successfully.\n         */\n        public boolean createSurface() {\n            if (LOG_EGL) {\n                Log.w(\"EglHelper\", \"createSurface()  tid=\" + Thread.currentThread().getId());\n            }\n            /*\n             * Check preconditions.\n             */\n            if (egl == null) {\n                throw new RuntimeException(\"egl not initialized\");\n            }\n            if (eglDisplay == null) {\n                throw new RuntimeException(\"eglDisplay not initialized\");\n            }\n            if (eglConfig == null) {\n                throw new RuntimeException(\"eglConfig not initialized\");\n            }\n\n            /*\n             *  The window size has changed, so we need to create a new\n             *  surface.\n             */\n            destroySurfaceImp();\n\n            /*\n             * Create an EGL surface we can render into.\n             */\n            GLTextureView view = glTextureViewWeakRef.get();\n            if (view != null) {\n                eglSurface = view.eglWindowSurfaceFactory.createWindowSurface(egl, eglDisplay, eglConfig,\n                        view.getSurfaceTexture());\n            } else {\n                eglSurface = null;\n            }","sourceCodeStart":950,"sourceCodeEnd":986,"githubUrl":"https://github.com/wasabeef/android-gpuimage/blob/ceea576ec931c2968431ad46f1fb2e6d68a542e2/library/src/main/java/jp/co/cyberagent/android/gpuimage/GLTextureView.java#L950-L986","documentation":"createSurface() found eglConfig null: EGL initialized and a display exists, but config selection never happened (or was explicitly nulled when the weak-referenced view died in start()). Surface creation cannot proceed without a chosen EGLConfig.","triggerScenarios":"createSurface() runs with eglConfig == null — chooseConfig() threw earlier, or start() detected glTextureViewWeakRef.get() == null and set eglConfig = null before finishing setup.","commonSituations":"Earlier 'No configs match configSpec' / 'No config chosen' failures partially handled, GLTextureView detached before EglHelper finished starting (weak ref cleared), component recycled mid-initialization.","solutions":["Fix the underlying config-selection failure that left eglConfig null","Ensure the GLTextureView stays attached/alive while its render thread initializes EGL","Recreate the EglHelper (call start() again) instead of proceeding with null config","Don't requestRender or touch the surface until onSurfaceCreated/onSurfaceAvailable"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (glTextureViewWeakRef.get() == null) { /* view detached: abort thread, don't proceed with null config */ }","typeGuard":null,"tryCatchPattern":"// catch (RuntimeException e) { stop GL thread; let re-attached view start a new EglHelper }","preventionTips":["Keep the view attached while its render thread initializes","Fix upstream config-selection errors that leave eglConfig null","Recreate EglHelper instead of reusing a half-initialized one"],"tags":["egl","android","opengl","lifecycle","config-selection"],"backgroundTag":"invalid-state-transition","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"}