{"record":{"id":"18a3cfd6558ef930","repo":"immich-app/immich","slug":"method-not-supported-on-this-android-version","errorCode":null,"errorMessage":"Method not supported on this Android version.","messagePattern":"Method not supported on this Android version\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"mobile/android/app/src/main/kotlin/app/alextran/immich/sync/MessagesImpl26.kt","lineNumber":30,"sourceCode":"    return true\n  }\n\n  // No-op for Android 10 and below\n  override fun checkpointSync() {\n    // Cannot throw exception as this is called from the Dart side\n    // during the full sync process as well\n  }\n\n  override fun clearSyncCheckpoint() {\n    // No-op for Android 10 and below\n  }\n\n  override fun getMediaChanges(callback: (Result<SyncDelta>) -> Unit) {\n    runSync(callback) { getMediaChanges() }\n  }\n\n  private fun getMediaChanges(): SyncDelta {\n    throw IllegalStateException(\"Method not supported on this Android version.\")\n  }\n\n  override fun getTrashedAssets(): Map<String, List<PlatformAsset>> {\n    //Method not supported on this Android version.\n    return emptyMap()\n  }\n}\n","sourceCodeStart":12,"sourceCodeEnd":38,"githubUrl":"https://github.com/immich-app/immich/blob/e55ac299a4ec7cb372e35dbf2c6c05ee9ce77f6c/mobile/android/app/src/main/kotlin/app/alextran/immich/sync/MessagesImpl26.kt#L12-L38","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Upgrade the device/emulator to an Android version where getMediaChanges is implemented","Use the alternative sync mechanism available on this Android version (e.g. polled full-sync / getTrashedAssets fallbacks instead of change deltas)","Guard the Dart caller with a capability/version check before invoking getMediaChanges"],"exampleFix":"// before\nfinal delta = await api.getMediaChanges();\n// after\nif (await api.supportsMediaChanges()) {\n  final delta = await api.getMediaChanges();\n} else {\n  final delta = await fullSyncDelta(); // legacy path\n}","handlingStrategy":"try-catch","validationCode":"// Dart: check OS capability before calling\nif (!await api.supportsMediaChanges()) {\n  return fullResyncDelta();\n}","typeGuard":"bool supportsMediaChanges(int sdkInt) => sdkInt >= MIN_SDK_FOR_MEDIA_CHANGES;","tryCatchPattern":"try {\n  delta = await api.getMediaChanges();\n} on PlatformException catch (e) {\n  log('media changes unsupported: ${e.message}');\n  delta = await fullResyncDelta();\n}","preventionTips":["Check device API level before using delta-sync APIs","Keep a documented fallback sync path per platform","Test sync flows on the minimum supported Android version"],"tags":["android","unsupported","sync","platform-capability"],"backgroundTag":"unsupported-platform","analyzedSha":"e55ac299a4ec7cb372e35dbf2c6c05ee9ce77f6c","analyzedAt":"2026-09-15T07:20:19.675Z","contentChangedAt":"2026-09-15T07:20:19.675Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}