-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Description
Details
Flutter 3.3.3
Target Platform: Android
We're using Platform View. It uses SurfaceView to render camera preview. We're using Hybrid Composition mode (initExpensiveAndroidView)
Steps to reproduce
- Install this app on Android device hybrid_composition_camera_example.zip
- Manually add camera permissions to this app (hc_app). It will not ask for permissions. Sorry about that.
- Run the app
- Tap 'Press me' button on home page.
- You will be navigated to a second screen which does NOT have a platform view.
- Rotate device to switch to landscape.
Expected
App switches to landscape. I still see the second screen. I don't see camera preview platform view.
Actual
App switches to landscape. Camera preview (platform view) is visible even though it is not in a widget hierarchy of this screen. It looks like it's rendered on top of everything. Camera preview takes up about half of the screen. When you switch back to portrait the camera preview will take up almost whole screen.
GIF of repro steps
This is the app that reproduces the issue
hybrid_composition_camera_example.zip
Additional notes
When using Virtual Display mode we don't have this issue but we have other issues on Android 12. We have been using Virtual Display and we are trying to switch to Hybrid Composition because of Android 12 issues.
Logs
Logs
Analyzing hybrid_composition_camera_example...
No issues found! (ran in 3.2s)
[✓] Flutter (Channel stable, 3.3.3, on macOS 12.4 21F79 darwin-x64, locale en-PL)
• Flutter version 3.3.3 on channel stable at /Users/pawel/bin/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 18a827f393 (7 days ago), 2022-09-28 10:03:14 -0700
• Engine revision 5c984c26eb
• Dart version 2.18.2
• DevTools version 2.15.0
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at /Users/pawel/Library/Android/sdk
• Platform android-33, build-tools 33.0.0
• ANDROID_HOME = /Users/pawel/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 13C100
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.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
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
[✓] VS Code (version 1.71.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.50.0
[✓] Connected device (3 available)
• SM A326B (mobile) • RFCR90FDRCM • android-arm64 • Android 12 (API 31)
• macOS (desktop) • macos • darwin-x64 • macOS 12.4 21F79 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 105.0.5195.125
! Error: Could not locate device support files. iPhone XR may be running a version of iOS that is not supported by this version of Xcode. You can download the latest version of Xcode
from the Mac App Store or developer.apple.com. (code 601)
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
