Skip to content

[camera_android_camerax] Update CameraX to 1.7.0 - #13775

Open
shalevmoyal-fs wants to merge 4 commits into
flutter:mainfrom
shalevmoyal-fs:camerax-1.7.0
Open

shalevmoyal-fs wants to merge 4 commits into
flutter:mainfrom
shalevmoyal-fs:camerax-1.7.0

Conversation

@shalevmoyal-fs

@shalevmoyal-fs shalevmoyal-fs commented Nov 24, 2026 •

Copy link
Copy Markdown

Bumps cameraxVersion from 1.6.2 to 1.7.0.

CameraX 1.7.0 artifacts declare minSdkVersion 24, so this raises the plugin's minSdk from 23 to 24 (and the matching Robolectric @Config(minSdk = ...) in Camera2CameraInfoTest). Per OS version support this should be a no-op for supported clients: Flutter lists Android 23 and earlier as unsupported, this package already requires Flutter >=3.44.0 (default minSdkVersion 24), and the other Android plugins in this repo are already at 24. One caveat: Flutter 3.44-3.47 only warn on minSdk 23, so an app that pins 23 will now fail the manifest merge. Minor version bump (0.7.7), as in #11441.

CameraX 1.7.0 deprecates the Camera2Interop V1 classes (Camera2CameraControl, Camera2CameraInfo, CaptureRequestOptions, Camera2Interop.Extender). The example app compiles the plugin with -Xlint:all -Werror, so the Java call sites get @SuppressWarnings("deprecation") with a comment. Moving to the V2 API (Camera2Interop.forUseCase() / forCameraControl() etc.) is left for a follow-up: flutter/flutter#197317 (each suppression has a TODO pointing to it). The Pigeon-generated CameraXLibrary.g.kt now emits Kotlin deprecation warnings for those three classes; they are warnings only and don't fail the build.

Other effects of the bump:

  • CameraX 1.7.0 classes carry Kotlin metadata 2.2.0 (1.6.2: 2.1.0) and depend on kotlin-stdlib 2.2.20, so apps need Kotlin 2.1.0 or newer (before: 2.0.0). A compiler-level check with kotlinc 2.0.21 fails against 1.7.0 and passes against 1.6.2; kotlinc 2.1.21 passes against 1.7.0. Flutter 3.44 apps on Kotlin 2.0.x would be affected (Flutter 3.47.4 already requires 2.2.20). I added a CHANGELOG line; alternatively the flutter: constraint could be raised to >=3.47.0 so those apps can't resolve this version. Which do you prefer?
  • New transitive artifact androidx.camera:camera-common:1.7.0; CameraX classes are now Java 11 bytecode.

This unblocks #13774, which needs Recorder.Builder.setVideoMimeType from CameraX 1.7.0.

Part of flutter/flutter#83074
Related: flutter/flutter#197317

Test exemption: manual dependency roll with no plugin code or API change. Existing Java unit tests, Dart tests and example APK builds (debug and release) pass. CameraX 1.7.0 itself is exercised on a real device (Samsung Galaxy A05, Android 14) through #13774, which includes this bump: video recording with and without a codec set works there.

Pre-Review Checklist

🤖 Generated with Claude Code

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2

@shalevmoyal-fs
shalevmoyal-fs marked this pull request as ready for review November 24, 2026 15:11

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the CameraX dependency from 1.6.2 to 1.7.0, raises the minimum Android SDK version to 24, and adds deprecation suppressions and TODOs across several proxy API classes to facilitate future migration to Camera2Interop V2. The reviewer suggests increasing the minimum Flutter constraint in pubspec.yaml to 3.47.0 to prevent build failures for projects using older Kotlin versions.

repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android_camerax
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
version: 0.7.6+2
version: 0.7.7

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since CameraX 1.7.0 requires Kotlin 2.1.0 or newer, keeping the flutter constraint at >=3.44.0 will cause build failures for apps on Flutter 3.44-3.46 that are still using Kotlin 2.0.x. To prevent these compile-time breakages, it is highly recommended to raise the minimum flutter constraint in pubspec.yaml to >=3.47.0 (which requires Kotlin 2.2.20) rather than relying solely on a CHANGELOG warning. This ensures that the pub dependency solver will correctly prevent older, incompatible Flutter projects from resolving to this version.

@loic-sharma
loic-sharma requested a review from camsim99 November 24, 2026 23:35
@loic-sharma loic-sharma added the triage-android Should be looked at in Android triage label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: camera platform-android triage-android Should be looked at in Android triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants