wasabeef/android-gpuimage · critical · IllegalStateException

OpenGL ES 2.0 is not supported on this phone.

Error message

OpenGL ES 2.0 is not supported on this phone.

What it means

The GPUImage constructor checks whether the device supports OpenGL ES 2.0 (via ActivityManager device configuration info, reqGlEsVersion). On devices lacking GLES 2.0 support it throws IllegalStateException because the whole rendering pipeline (GPUImageRenderer) cannot function.

Solutions

  1. Enable GPU/graphics acceleration on the emulator (hardware GLES 2.0) or test on a physical device with GLES 2.0+.
  2. Check support before constructing: use GPUImage's supportsOpenGLES2 logic (ActivityManager device info) and degrade gracefully.
  3. If the device genuinely lacks GLES 2.0, provide a non-GPU fallback image pipeline or refuse to enable GPU-image features.

Example fix

// before
 GPUImage gpuImage = new GPUImage(context);
// after
 if (supportsOpenGLES2(context)) {
     GPUImage gpuImage = new GPUImage(context);
 } else {
     // fall back to non-GL rendering
 }
Defensive patterns

Strategy: validation

Validate before calling

final ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
final ConfigurationInfo info = am.getDeviceConfigurationInfo();
boolean gles2Ok = info.reqGlEsVersion >= 0x20000;
if (!gles2Ok) { /* fallback or disable GPU features */ }

Try / catch

try {
    GPUImage gpuImage = new GPUImage(context);
} catch (IllegalStateException e) {
    // device lacks OpenGL ES 2.0; enable non-GPU fallback
}

Prevention

When it happens

Trigger: Instantiating new GPUImage(context) on a device or emulator whose reported OpenGL ES version is below 2.0, or where ActivityManager.getDeviceConfigurationInfo() returns a reqGlEsVersion < 0x20000.

Common situations: Very old or unusual devices; emulators without GPU/host-GPU emulation enabled; headless CI emulators; embedded/kiosk hardware; running in an environment where the GPU is disabled (e.g. some x86 emulator images without GPU emulation).

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


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

Appendix: source

Thrown at library/src/main/java/jp/co/cyberagent/android/gpuimage/GPUImage.java:79

    private final Context context;
    private final GPUImageRenderer renderer;
    private int surfaceType = SURFACE_TYPE_SURFACE_VIEW;
    private GLSurfaceView glSurfaceView;
    private GLTextureView glTextureView;
    private GPUImageFilter filter;
    private Bitmap currentBitmap;
    private ScaleType scaleType = ScaleType.CENTER_CROP;
    private int scaleWidth, scaleHeight;

    /**
     * Instantiates a new GPUImage object.
     *
     * @param context the context
     */
    public GPUImage(final Context context) {
        if (!supportsOpenGLES2(context)) {
            throw new IllegalStateException("OpenGL ES 2.0 is not supported on this phone.");
        }

        this.context = context;
        filter = new GPUImageFilter();
        renderer = new GPUImageRenderer(filter);
    }

    /**
     * Checks if OpenGL ES 2.0 is supported on the current device.
     *
     * @param context the context
     * @return true, if successful
     */
    private boolean supportsOpenGLES2(final Context context) {
        final ActivityManager activityManager = (ActivityManager)
                context.getSystemService(Context.ACTIVITY_SERVICE);
        final ConfigurationInfo configurationInfo =
                activityManager.getDeviceConfigurationInfo();

View on GitHub (pinned to ceea576ec9)