[Android] CameraX preview is rotated 90 degrees
Problem
What package does this bug report belong to? camera What target platforms are you seeing this bug on? Android Have you already upgraded your packages? Yes Dependency versions <details><summary>pubspec.yaml</summary> [code block] </details> <details><summary>pubspec.lock</summary> [code block] </details> Steps to reproduce 1. Open the application 2. Confirm camera permissions 3. See improperly rotated preview Expected results The camera preview should be properly rotated. Actual results The camera preview is rotated 90º. Code sample <details open><summary>Code sample</summary> [code block] </details> Screenshots or Videos _No response_ Logs _No response_ Flutter Doctor output <details open><summary>Doctor output</summary> [code block] </details> Additional: This issue reproduces on a Pixel 1 device. I wasn't able to test this on a more capable device. The issue first occurs with the `camera_android_camerax: 0.6.8+2` if I override the dependency to: `camera_android_camerax: 0.6.7+2` everything works as expected.
Error Output
error:
return const Center(
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: [Android] CameraX preview is rotated 90 degrees
I have the same problem. I don't know if this problem is happening for specific devices. Still, I remember I was using the camera package with version 0.11.0+1 and Flutter version 3.22.1 in mid-July, and everything was working fine. ( on the same mobile phone ) I guess something has changed in camera_android_camerax that caused this rotation. I just checked with the latest Flutter version(3.24.2)
Trust Score
4 verifications
- 1
I have the same problem.
I don't know if this problem is happening for specific devices. Still, I remember I was using the camera package with version 0.11.0+1 and Flutter version 3.22.1 in mid-July, and everything was working fine. ( on the same mobile phone ) I guess something has changed in camera_android_camerax that caused this rotation. I just checked with the latest Flutter version(3.24.2) which was released yesterday and no luck :(
Validation
Resolved in flutter/flutter GitHub issue #154241. Community reactions: 5 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep