Skip to content

[camera_android_camerax] Camera preview is rotated on the supported Impeller version #149294

Closed
flutter/packages
#6856

Description

@xuegao-tzx

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

pubspec.lock
camera_android_camerax 0.6.5+4

Steps to reproduce

  1. In the version camera_android_camerax 0.6.5+4 after this commit, the preview camera screen is displayed abnormally, and the up, down, left, and right movement directions are also abnormal. This version will display abnormally regardless of whether io.flutter.embedding.android.EnableImpeller is set to true.
  2. Test device: Google Android 15 AP31.240426.023 and HuaWei Android12.0 API31

Expected results

This is the original normal screenshot:

This is the original normal screen recording:

normal.mp4

Actual results

This is the current abnormal screenshot:

This is the current abnormal screen recording:

error.mp4

Code sample

Code sample
if (isCameraReady)
          SizedBox(
            width: cameraMaxSize,
            height: cameraMaxSize,
            child: ClipRRect(
              child: OverflowBox(
                child: FittedBox(
                  fit: BoxFit.cover,
                  child: SizedBox(
                    width: cameraMaxSize,
                    child: CameraPreview(
                      controller!
                    ),
                  ),
                ),
              ),
            ),
          ),

Screenshots or Videos

Screenshots / Video demonstration
error.mp4

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
$ flutter doctor -v
[✓] Flutter (Channel beta, 3.22.1, on macOS 14.5 23F79 darwin-arm64, locale zh-Hans-CN)
    • Flutter version 3.22.1 on channel beta at /opt/homebrew/Caskroom/flutter/3.10.5/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision a14f74ff3a (7 天前), 2024-05-22 11:08:21 -0500
    • Engine revision 55eae6864b
    • Dart version 3.4.1
    • DevTools version 2.34.3
    • Flutter download mirror https://mirrors.tuna.tsinghua.edu.cn/flutter

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/xuegao/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/xuegao/Library/Android/sdk
    • Java binary at: /Applications/Android Studio
      Preview.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome
      Canary

[!] Android Studio (version unknown)
    • Android Studio at /Applications/Android Studio Preview.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to determine Android Studio version.
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)

[✓] IntelliJ IDEA Ultimate Edition (version 2024.1.2)
    • IntelliJ at /Users/xuegao/Applications/IntelliJ IDEA Ultimate.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.90.0-insider)
    • VS Code at /Applications/Visual Studio Code - Insiders.app/Contents
    • Flutter extension version 3.89.20240501

[✓] Connected device (6 available)
    • ALN AL10 (mobile)               • 23F0213C21011631                                 •
      android-arm64  • Android 12 (API 31)
    • Pixel 7 Pro (mobile)            • 192.168.2.104:38723                              •
      android-arm64  • Android 14 (API 34)
    • macOS (desktop)                 • macos                                            •
      darwin-arm64   • macOS 14.5 23F79 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad                            •
      darwin         • macOS 14.5 23F79 darwin-arm64
    • Chrome (web)                    • chrome                                           •
      web-javascript • Google Chrome 127.0.6508.0 canary

[✓] Network resources
    • All expected network resources are available.

Activity

  1. added
    in triagePresently being triaged by the triage team
    on May 30, 2024
  2. huycozy commented on May 30, 2024

    @huycozy
    Member

    Thanks for the report. Reproduced this issue using camera_android_camerax's example. The camera preview is rotated 90 degree.

    Demo
    latest version 0.6.5+4 ❗ previous version 0.6.5+3 ✅

    ✅: No Issue ❗: Issue reproduced

    flutter doctor -v (stable and master)
    [✓] Flutter (Channel stable, 3.22.1, on macOS 14.1 23B74 darwin-x64, locale en-VN)
        • Flutter version 3.22.1 on channel stable at /Users/huynq/Documents/GitHub/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision a14f74ff3a (11 hours ago), 2024-05-22 11:08:21 -0500
        • Engine revision 55eae6864b
        • Dart version 3.4.1
        • DevTools version 2.34.3
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
        • Android SDK at /Users/huynq/Library/Android/sdk
        • Platform android-34, build-tools 34.0.0
        • ANDROID_HOME = /Users/huynq/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 15.3)
        • Xcode at /Applications/Xcode15.3.app/Contents/Developer
        • Build 15E204a
        • CocoaPods version 1.15.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2023.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • android-studio-dir = /Applications/Android Studio.app/
        • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    
    [✓] VS Code (version 1.89.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.88.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-x64     • macOS 14.1 23B74 darwin-x64
        • Chrome (web)    • chrome • web-javascript • Google Chrome 125.0.6422.76
    
    [✓] Network resources
        • All expected network resources are available.
    
    • No issues found!
    [!] Flutter (Channel master, 3.23.0-13.0.pre.19, on macOS 14.1 23B74 darwin-x64, locale en-VN)
        • Flutter version 3.23.0-13.0.pre.19 on channel master at /Users/huynq/Documents/GitHub/flutter_master
        ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
        ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision c787dc99bd (45 minutes ago), 2024-05-29 22:28:10 -0400
        • Engine revision 4adf453b6d
        • Dart version 3.5.0 (build 3.5.0-203.0.dev)
        • DevTools version 2.36.0-dev.10
        • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
        • Android SDK at /Users/huynq/Library/Android/sdk
        • Platform android-34, build-tools 34.0.0
        • ANDROID_HOME = /Users/huynq/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 15.3)
        • Xcode at /Applications/Xcode15.3.app/Contents/Developer
        • Build 15E204a
        • CocoaPods version 1.15.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2023.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • android-studio-dir = /Applications/Android Studio.app/
        • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    
    [✓] VS Code (version 1.89.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.88.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-x64     • macOS 14.1 23B74 darwin-x64
        • Chrome (web)    • chrome • web-javascript • Google Chrome 125.0.6422.113
    
    [✓] Network resources
        • All expected network resources are available.
    
    ! Doctor found issues in 1 category.
  3. changed the title [-]camera android after Supports Impeller Display Error[/-] [+][camera_android_camerax] Camera preview is rotated on the supported Impeller version[/+] on May 30, 2024
  4. added
    platform-androidAndroid applications specifically
    engineflutter/engine related. See also e: labels.
    packageflutter/packages repository. See also p: labels.
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    fyi-androidFor the attention of Android platform team
    e: impellerImpeller rendering backend issues and features requests
    c: regressionIt was better in the past than it is now
    and removed
    in triagePresently being triaged by the triage team
    on May 30, 2024
  5. 14 remaining items

  6. reidbaker commented on Jun 28, 2024

    @reidbaker
    Contributor

    @GorinMaxim there is an open pull request to fix the issue flutter/packages#6856

    Thank you for trying impeller.

  7. GorinMaxim commented on Jun 28, 2024

    @GorinMaxim

    it might be useful

    [✓] Flutter (Channel stable, 3.22.2, on macOS 14.4.1 23E224 darwin-arm64, locale en-RU)
    • Flutter version 3.22.2 on channel stable at /Users/maximgorin/Library/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 761747b (3 weeks ago), 2024-06-05 22:15:13 +0200
    • Engine revision edd8546116
    • Dart version 3.4.3
    • DevTools version 2.34.3

    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/maximgorin/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

    [✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

    [✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

    [✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
    🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
    🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

    [✓] VS Code (version 1.90.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.90.0

    [✓] Network resources
    • All expected network resources are available.

    • No issues found!

    I also noticed that version 0.10.6 works well with flutter 3.16.9, but rotated at flutter 3.22.2

  8. AlexV525 commented on Aug 21, 2024

    @AlexV525
    Member

    @camsim99 Are you planning to land a similar approach for camera_android? See #150549

  9. added
    r: fixedIssue is closed as already fixed in a newer version
    on Aug 21, 2024
  10. reidbaker commented on Aug 21, 2024

    @reidbaker
    Contributor
  11. AlexV525 commented on Aug 21, 2024

    @AlexV525
    Member

    @AlexV525 #150549 (comment)

    Sorry, so you are talking about that you don't want to reland flutter/packages#6461 for camera_android but you already reland flutter/packages#7044 for camera_android_camerax? 0.10.9+6 fixes that issue because I reverted flutter/packages#6461 and that request has never been brought to the implementation again. Now it seems nobody cares and trying to avoid landing it because I've tried my best to tell everyone that the issue has not been really fixed.

  12. stuartmorgan-g commented on Aug 21, 2024

    @stuartmorgan-g
    Contributor

    @AlexV525 The situation has been pretty complex, with PRs being landed and reverted across several plugins and the repro cases being different as to whether they are about impeller or non-impeller codepaths, and all of that being conflated into a small number of issues.

    Filing a new issue clearly describing the current state of the issue, with current repro steps (as well as links to relevant context) would be much more productive—and much more consistent with our code of conduct—than attributing bad intent to other project members.

  13. github-actions commented on Sep 4, 2024

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  14. locked as resolved and limited conversation to collaborators on Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: regressionIt was better in the past than it is nowe: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.found in release: 3.22Found to occur in 3.22found in release: 3.23Found to occur in 3.23fyi-androidFor the attention of Android platform teamhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: cameraThe camera pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions