libgdx/libgdx · error · GdxRuntimeException

iOS audio is not enabled by the application config

Error message

iOS audio is not enabled by the application config

What it means

DisabledIOSAudio is the no-op Audio implementation installed when the RoboVM application config leaves audio disabled. Its newAudioDevice throws GdxRuntimeException because there is no real audio hardware binding to back an AudioDevice.

Source

Thrown at backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/DisabledIOSAudio.java:30

	@Override
	public void didBecomeActive () {
	}

	@Override
	public void willEnterForeground () {
	}

	@Override
	public void willResignActive () {
	}

	@Override
	public void dispose () {
	}

	@Override
	public AudioDevice newAudioDevice (int samplingRate, boolean isMono) {
		throw new GdxRuntimeException("iOS audio is not enabled by the application config");
	}

	@Override
	public AudioRecorder newAudioRecorder (int samplingRate, boolean isMono) {
		throw new GdxRuntimeException("iOS audio is not enabled by the application config");
	}

	@Override
	public Sound newSound (FileHandle fileHandle) {
		throw new GdxRuntimeException("iOS audio is not enabled by the application config");
	}

	@Override
	public Music newMusic (FileHandle file) {
		throw new GdxRuntimeException("iOS audio is not enabled by the application config");
	}

	@Override

View on GitHub (pinned to 97f4086187)

Solutions

  1. Enable audio in the iOS application configuration used to bootstrap the RoboVM application so the real ObjectAL audio implementation is installed.
  2. Guard cross-platform audio-recording/playback features behind a capability check (e.g. platform constant) so iOS-with-audio-disabled builds skip them.
  3. Wrap the call in try/catch GdxRuntimeException and disable the PCM audio feature gracefully.

Example fix

// before
AudioDevice device = Gdx.audio.newAudioDevice(44100, false); // throws when audio disabled

// after
try {
    AudioDevice device = Gdx.audio.newAudioDevice(44100, false);
} catch (GdxRuntimeException e) {
    Gdx.app.error("Audio", "newAudioDevice unavailable (audio disabled in iOS config)");
}
Defensive patterns

Strategy: validation

Validate before calling

if (Gdx.app.getType() != ApplicationType.iOS || audioEnabledInConfig) {
    device = Gdx.audio.newAudioDevice(44100, false);
}

Try / catch

try { Gdx.audio.newAudioDevice(...); } catch (GdxRuntimeException e) { /* PCM output unsupported here */ }

Prevention

When it happens

Trigger: Calling Gdx.audio.newAudioDevice(samplingRate, isMono) on iOS when the IOSApplicationConfiguration / RoboVM bootstrap did not enable audio, so the DisabledIOSAudio stub is wired in.

Common situations: Disabling audio for faster startup or because background-audio entitlements are missing; then a shared code path (desktop-tested) still calls newAudioDevice for microphone/PCM output features.

Related errors


AI-assisted analysis of libgdx/libgdx@97f4086187 (2026-08-14). Data as JSON: /api/errors/3528bec9ff35f091. Report an issue: GitHub.