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");
}
@OverrideView on GitHub (pinned to 97f4086187)
Solutions
- Enable audio in the iOS application configuration used to bootstrap the RoboVM application so the real ObjectAL audio implementation is installed.
- Guard cross-platform audio-recording/playback features behind a capability check (e.g. platform constant) so iOS-with-audio-disabled builds skip them.
- 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
- Enable audio in the iOS app config if any audio API is used
- Gate PCM features behind platform checks
- Log Gdx.audio class at startup to confirm the real implementation is bound
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
- iOS audio is not enabled by the application config
- Error creating music audio track
- Error creating music audio track
- Can't open KeyBoard, if TextInputField KeyBoard is already o
- Can't open TextInputField, if KeyBoard is already open
AI-assisted analysis of libgdx/libgdx@97f4086187 (2026-08-14).
Data as JSON: /api/errors/3528bec9ff35f091.
Report an issue: GitHub.