# GLSurfaceView: setRenderer has not been called

- **ID:** `android/glsurfaceview-renderer-not-set`
- **Domain:** android
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

GLSurfaceView is used without setting a Renderer via setRenderer(), so no OpenGL rendering context is created.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Android 4.0+ | active | — | — |
| OpenGL ES 2.0+ | active | — | — |

## Workarounds

1. **Call setRenderer() with a valid Renderer implementation in onCreate() or after view initialization** (95% success)
   ```
   Call setRenderer() with a valid Renderer implementation in onCreate() or after view initialization
   ```
2. **Ensure the Renderer class implements GLSurfaceView.Renderer and overrides onSurfaceCreated, onDrawFrame, onSurfaceChanged** (90% success)
   ```
   Ensure the Renderer class implements GLSurfaceView.Renderer and overrides onSurfaceCreated, onDrawFrame, onSurfaceChanged
   ```
3. **If using a custom view, call setRenderer in the constructor after super()** (85% success)
   ```
   If using a custom view, call setRenderer in the constructor after super()
   ```

## Dead Ends

- **** — requestRender() requires a renderer to be set; without it, the call is ignored and the error persists. (90% fail)
- **** — setRenderer() must be called on the main thread; doing so on another thread may cause race conditions or silent failure. (60% fail)
- **** — XML declaration alone does not call setRenderer(); it must be done in code after creating the view. (80% fail)
