immich-app/immich · error · IllegalStateException

Method not supported on this Android version.

Error message

Method not supported on this Android version.

What it means

getMediaChanges() in the Android API-26 sync implementation is intentionally unimplemented: live media-change deltas require Photo Change Observer APIs available only on newer Android versions. The base class throws IllegalStateException immediately whenever the Dart side calls this platform channel method on an unsupported device.

Solutions

  1. Upgrade the device/emulator to an Android version where getMediaChanges is implemented
  2. Use the alternative sync mechanism available on this Android version (e.g. polled full-sync / getTrashedAssets fallbacks instead of change deltas)
  3. Guard the Dart caller with a capability/version check before invoking getMediaChanges

Example fix

// before
final delta = await api.getMediaChanges();
// after
if (await api.supportsMediaChanges()) {
  final delta = await api.getMediaChanges();
} else {
  final delta = await fullSyncDelta(); // legacy path
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Dart: check OS capability before calling
if (!await api.supportsMediaChanges()) {
  return fullResyncDelta();
}

Type guard

bool supportsMediaChanges(int sdkInt) => sdkInt >= MIN_SDK_FOR_MEDIA_CHANGES;

Try / catch

try {
  delta = await api.getMediaChanges();
} on PlatformException catch (e) {
  log('media changes unsupported: ${e.message}');
  delta = await fullResyncDelta();
}

Prevention

When it happens

Trigger: Calling getMediaChanges on the MessagesImpl26 (Android API 26/27) sync implementation; any sync flow that requests a media-change delta on a device running Android below the version where change observation is supported.

Common situations: Users running Immich's background sync on older Android devices (API 26/27) or emulators pinned to an old API level; apps falling back to the legacy sync channel after a version check misclassifies the device.

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 immich-app/immich@e55ac299a4 (2026-09-15). Data as JSON: /api/errors/18a3cfd6558ef930. Report an issue: GitHub.

Appendix: source

Thrown at mobile/android/app/src/main/kotlin/app/alextran/immich/sync/MessagesImpl26.kt:30

    return true
  }

  // No-op for Android 10 and below
  override fun checkpointSync() {
    // Cannot throw exception as this is called from the Dart side
    // during the full sync process as well
  }

  override fun clearSyncCheckpoint() {
    // No-op for Android 10 and below
  }

  override fun getMediaChanges(callback: (Result<SyncDelta>) -> Unit) {
    runSync(callback) { getMediaChanges() }
  }

  private fun getMediaChanges(): SyncDelta {
    throw IllegalStateException("Method not supported on this Android version.")
  }

  override fun getTrashedAssets(): Map<String, List<PlatformAsset>> {
    //Method not supported on this Android version.
    return emptyMap()
  }
}

View on GitHub (pinned to e55ac299a4)