Open
Description
Steps to reproduce
Steps to reproduce
- run example app, take not of the official orientation the app loaded with
- rotate device into another orientation
- take picture
- rotate device back into portrait
Expected results
picture orientation should match phone orientation
Actual results
Photo orientation remains in original orientation
Code sample
Code sample
I used the example app, I only moved the _thumbnailWidget location because I had an overflow issue// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:io';
import 'package:camera/camera.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
/// Camera example home widget.
class CameraExampleHome extends StatefulWidget {
/// Default Constructor
const CameraExampleHome({super.key});
@override
State<CameraExampleHome> createState() {
return _CameraExampleHomeState();
}
}
void _logError(String code, String? message) {
// ignore: avoid_print
print('Error: $code${message == null ? '' : '\nError Message: $message'}');
}
class _CameraExampleHomeState extends State<CameraExampleHome> {
CameraController? controller;
XFile? imageFile;
bool enableAudio = true;
double _minAvailableZoom = 1.0;
double _maxAvailableZoom = 1.0;
double _currentScale = 1.0;
double _baseScale = 1.0;
// Counting pointers (number of user fingers on screen)
int _pointers = 0;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Camera example'),
),
body: Column(
children: <Widget>[
Expanded(
child: Container(
decoration: BoxDecoration(
color: Colors.black,
border: Border.all(
color:
controller != null && controller!.value.isRecordingVideo
? Colors.redAccent
: Colors.grey,
width: 3.0,
),
),
child: Padding(
padding: const EdgeInsets.all(1.0),
child: Center(
child: Stack(
children: [
_cameraPreviewWidget(),
_thumbnailWidget(),
],
),
),
),
),
),
_captureControlRowWidget(),
Padding(
padding: const EdgeInsets.all(5.0),
child: Row(
children: <Widget>[
_cameraTogglesRowWidget(),
],
),
),
],
),
);
}
/// Display the preview from the camera (or a message if the preview is not available).
Widget _cameraPreviewWidget() {
final CameraController? cameraController = controller;
if (cameraController == null || !cameraController.value.isInitialized) {
return const Text(
'Tap a camera',
style: TextStyle(
color: Colors.white,
fontSize: 24.0,
fontWeight: FontWeight.w900,
),
);
} else {
return Listener(
onPointerDown: (_) => _pointers++,
onPointerUp: (_) => _pointers--,
child: CameraPreview(
controller!,
child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onScaleStart: _handleScaleStart,
onScaleUpdate: _handleScaleUpdate,
onTapDown: (TapDownDetails details) =>
onViewFinderTap(details, constraints),
);
}),
),
);
}
}
void _handleScaleStart(ScaleStartDetails details) {
_baseScale = _currentScale;
}
Future<void> _handleScaleUpdate(ScaleUpdateDetails details) async {
// When there are not exactly two fingers on screen don't scale
if (controller == null || _pointers != 2) {
return;
}
_currentScale = (_baseScale * details.scale)
.clamp(_minAvailableZoom, _maxAvailableZoom);
await controller!.setZoomLevel(_currentScale);
}
/// Display the thumbnail of the captured image or video.
Widget _thumbnailWidget() {
return Expanded(
child: Align(
alignment: Alignment.centerRight,
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
if (imageFile == null)
Container()
else
SizedBox(
width: 100.0,
height: 100.0,
child: (
// The captured image on the web contains a network-accessible URL
// pointing to a location within the browser. It may be displayed
// either with Image.network or Image.memory after loading the image
// bytes to memory.
kIsWeb
? Image.network(imageFile!.path)
: Image.file(File(imageFile!.path))),
),
],
),
),
);
}
/// Display the control bar with buttons to take pictures and record videos.
Widget _captureControlRowWidget() {
final CameraController? cameraController = controller;
return Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
IconButton(
icon: const Icon(Icons.camera_alt),
color: Colors.blue,
onPressed: cameraController != null &&
cameraController.value.isInitialized &&
!cameraController.value.isRecordingVideo
? onTakePictureButtonPressed
: null,
),
],
);
}
/// Display a row of toggle to select the camera (or a message if no camera is available).
Widget _cameraTogglesRowWidget() {
final List<Widget> toggles = <Widget>[];
void onChanged(CameraDescription? description) {
if (description == null) {
return;
}
onNewCameraSelected(description);
}
if (_cameras.isEmpty) {
SchedulerBinding.instance.addPostFrameCallback((_) async {
showInSnackBar('No camera found.');
});
return const Text('None');
} else {
for (final CameraDescription cameraDescription in _cameras) {
toggles.add(
SizedBox(
width: 90.0,
child: RadioListTile<CameraDescription>(
title: Icon(Icons.camera),
groupValue: controller?.description,
value: cameraDescription,
onChanged: onChanged,
),
),
);
}
}
return Row(children: toggles);
}
String timestamp() => DateTime.now().millisecondsSinceEpoch.toString();
void showInSnackBar(String message) {
ScaffoldMessenger.of(context)
.showSnackBar(SnackBar(content: Text(message)));
}
void onViewFinderTap(TapDownDetails details, BoxConstraints constraints) {
if (controller == null) {
return;
}
final CameraController cameraController = controller!;
final Offset offset = Offset(
details.localPosition.dx / constraints.maxWidth,
details.localPosition.dy / constraints.maxHeight,
);
cameraController.setExposurePoint(offset);
cameraController.setFocusPoint(offset);
}
Future<void> onNewCameraSelected(CameraDescription cameraDescription) async {
if (controller != null) {
return controller!.setDescription(cameraDescription);
} else {
return _initializeCameraController(cameraDescription);
}
}
Future<void> _initializeCameraController(
CameraDescription cameraDescription) async {
final CameraController cameraController = CameraController(
cameraDescription,
kIsWeb ? ResolutionPreset.max : ResolutionPreset.medium,
enableAudio: enableAudio,
imageFormatGroup: ImageFormatGroup.jpeg,
);
controller = cameraController;
// If the controller is updated then update the UI.
cameraController.addListener(() {
if (mounted) {
setState(() {});
}
if (cameraController.value.hasError) {
showInSnackBar(
'Camera error ${cameraController.value.errorDescription}');
}
});
try {
await cameraController.initialize();
await Future.wait(<Future<Object?>>[
cameraController
.getMaxZoomLevel()
.then((double value) => _maxAvailableZoom = value),
cameraController
.getMinZoomLevel()
.then((double value) => _minAvailableZoom = value),
]);
} on CameraException catch (e) {
switch (e.code) {
case 'CameraAccessDenied':
showInSnackBar('You have denied camera access.');
case 'CameraAccessDeniedWithoutPrompt':
// iOS only
showInSnackBar('Please go to Settings app to enable camera access.');
case 'CameraAccessRestricted':
// iOS only
showInSnackBar('Camera access is restricted.');
case 'AudioAccessDenied':
showInSnackBar('You have denied audio access.');
case 'AudioAccessDeniedWithoutPrompt':
// iOS only
showInSnackBar('Please go to Settings app to enable audio access.');
case 'AudioAccessRestricted':
// iOS only
showInSnackBar('Audio access is restricted.');
default:
_showCameraException(e);
}
}
if (mounted) {
setState(() {});
}
}
void onTakePictureButtonPressed() {
takePicture().then((XFile? file) {
if (mounted) {
setState(() {
imageFile = file;
});
if (file != null) {
showInSnackBar('Picture saved to ${file.path}');
}
}
});
}
Future<XFile?> takePicture() async {
final CameraController? cameraController = controller;
if (cameraController == null || !cameraController.value.isInitialized) {
showInSnackBar('Error: select a camera first.');
return null;
}
if (cameraController.value.isTakingPicture) {
// A capture is already pending, do nothing.
return null;
}
try {
final XFile file = await cameraController.takePicture();
return file;
} on CameraException catch (e) {
_showCameraException(e);
return null;
}
}
void _showCameraException(CameraException e) {
_logError(e.code, e.description);
showInSnackBar('Error: ${e.code}\n${e.description}');
}
}
/// CameraApp is the Main Application.
class CameraApp extends StatelessWidget {
/// Default Constructor
const CameraApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: CameraExampleHome(),
);
}
}
List<CameraDescription> _cameras = <CameraDescription>[];
Future<void> main() async {
// Fetch the available cameras before initializing the app.
try {
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);
_cameras = await availableCameras();
} on CameraException catch (e) {
_logError(e.code, e.description);
}
runApp(const CameraApp());
}
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
restarted application in 730ms.
D/CameraOrientationUtil(31716): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/CameraOrientationUtil(31716): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
D/CameraOrientationUtil(31716): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/CameraOrientationUtil(31716): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
I/ViewRootImpl@d41d647[MainActivity](31716): onDisplayChanged oldDisplayState=2 newDisplayState=2
I/ViewRootImpl@d41d647[MainActivity](31716): Resizing android.view.ViewRootImpl@c752230: frame = [0,0][1080,2340] reportDraw = true forceLayout = false syncSeqId = -1
I/InsetsController(31716): onStateChanged: host=com.example.camera_poc/com.example.camera_poc.MainActivity, from=android.view.ViewRootImpl.relayoutWindow:10165, state=InsetsState: {mDisplayFrame=Rect(0, 0 - 1080, 2340), mDisplayCutout=DisplayCutout{insets=Rect(0, 81 - 0, 0) waterfall=Insets{left=0, top=0, right=0, bottom=0} boundingRect={Bounds=[Rect(0, 0 - 0, 0), Rect(512, 0 - 568, 81), Rect(0, 0 - 0, 0), Rect(0, 0 - 0, 0)]} cutoutPathParserInfo={CutoutPathParserInfo{displayWidth=1080 displayHeight=2340 physicalDisplayWidth=1080 physicalDisplayHeight=2340 density={3.0} cutoutSpec={M 0,0 H -9.333333333333333 V 27 H 9.333333333333333 V 0 H 0 Z @dp} rotation={0} scale={1.0} physicalPixelDisplaySizeRatio={1.0}}}}, mRoundedCorners=RoundedCorners{[RoundedCorner{position=TopLeft, radius=102, center=Point(102, 102)}, RoundedCorner{position=TopRight, radius=102, center=Point(978, 102)}, RoundedCorner{position=BottomRight, radius=102, center=Point(978, 2238)}, RoundedCorner{position=BottomLeft, radius=102, center=Point(102, 2238)}]} mRoundedCornerFrame=Rect(0, 0 - 1080, 2340), mPrivacyIndicatorBounds=PrivacyIndicatorBounds {static bounds=Rect(948, 0 - 1080, 81) rotation=0}, mDisplayShape=DisplayShape{ spec=-311912193 displayWidth=1080 displayHeight=2340 physicalPixelDisplaySizeRatio=1.0 rotation=0 offsetX=0 offsetY=0 scale=1.0}, mSources= { InsetsSource: {b40b0001 mType=navigationBars mFrame=[0,2196][1080,2340] mVisible=true mFlags=[]}, InsetsSource: {b40b0004 mType=systemGestures mFrame=[0,0][0,0] mVisible=true mFlags=[]}, InsetsSource: {b40b0005 mType=mandatorySystemGestures mFrame=[0,2196][1080,2340] mVisible=true mFlags=[]}, InsetsSource: {b40b0006 mType=tappableElement mFrame=[0,2196][1080,2340] mVisible=true mFlags=[]}, InsetsSource: {b40b0024 mType=systemGestures mFrame=[0,0][0,0] mVisible=true mFlags=[]}, InsetsSource: {3 mType=ime mFrame=[0,0][0,0] mVisible=false mFlags=[]}, InsetsSource: {27 mType=displayCutout mFrame=[0,0][1080,81] mVisible=true mFlags=[]}, InsetsSource: {6f210000 mType=statusBars mFrame=[0,0][1080,81] mVisible=true mFlags=[]}, InsetsSource: {6f210005 mType=mandatorySystemGestures mFrame=[0,0][1080,117] mVisible=true mFlags=[]}, InsetsSource: {6f210006 mType=tappableElement mFrame=[0,0][1080,81] mVisible=true mFlags=[]} }
I/InsetsSourceConsumer(31716): applyRequestedVisibilityToControl: visible=true, type=statusBars, host=com.example.camera_poc/com.example.camera_poc.MainActivity
I/InsetsSourceConsumer(31716): applyRequestedVisibilityToControl: visible=true, type=navigationBars, host=com.example.camera_poc/com.example.camera_poc.MainActivity
I/BLASTBufferQueue_Java(31716): update, w= 1080 h= 2340 mName = ViewRootImpl@d41d647[MainActivity] mNativeObject= 0xb4000071fefd8830 sc.mNativeObject= 0xb40000717efd9150 format= -3 caller= android.view.ViewRootImpl.updateBlastSurfaceIfNeeded:3074 android.view.ViewRootImpl.relayoutWindow:10224 android.view.ViewRootImpl.performTraversals:4167 android.view.ViewRootImpl.doTraversal:3345 android.view.ViewRootImpl$TraversalRunnable.run:11437 android.view.Choreographer$CallbackRecord.run:1690
I/ViewRootImpl@d41d647[MainActivity](31716): Relayout returned: old=(81,0,2340,1080) new=(0,0,1080,2340) relayoutAsync=false req=(2259,1080)0 dur=19 res=0x401 s={true 0xb4000070aeff3d70} ch=false seqId=5
D/ViewRootImpl@d41d647[MainActivity](31716): mThreadedRenderer.updateSurface() mSurface={isValid=true 0xb4000070aeff3d70}
I/ViewRootImpl@d41d647[MainActivity](31716): updateBoundsLayer: t=android.view.SurfaceControl$Transaction@c223856 sc=Surface(name=Bounds for - com.example.camera_poc/com.example.camera_poc.MainActivity@1)/@0xcee64b6 frame=4
I/SurfaceView(31716): 148637425 Changes: creating=false format=false size=true visible=false alpha=false hint=true visible=false left=false top=false z=false attached=true lifecycleStrategy=false
I/SurfaceView@8dc06f1(31716): 148637425 Cur surface: Surface(name=null)/@0xdd6bb72
I/BLASTBufferQueue_Java(31716): update, w= 1080 h= 2196 mName = null mNativeObject= 0xb4000071fefd7ed0 sc.mNativeObject= 0xb40000717eff0250 format= 4 caller= android.view.SurfaceView.setBufferSize:1439 android.view.SurfaceView.performSurfaceTransaction:995 android.view.SurfaceView.updateSurface:1211 android.view.SurfaceView.setFrame:559 android.view.View.layout:25782 android.widget.FrameLayout.layoutChildren:332
I/SurfaceView@8dc06f1(31716): pST: sr = Rect(0, 0 - 1080, 2196) sw = 1080 sh = 2196
D/SurfaceView@8dc06f1(31716): 148637425 performSurfaceTransaction RenderWorker position = [0, 0, 1080, 2196] surfaceSize = 1080x2196
I/SurfaceView@8dc06f1(31716): updateSurface: mVisible = true mSurface.isValid() = true
I/SurfaceView@8dc06f1(31716): updateSurface: mSurfaceCreated = true surfaceChanged = false visibleChanged = false
I/SurfaceView(31716): 148637425 surfaceChanged -- format=4 w=1080 h=2196
I/SurfaceView@8dc06f1(31716): surfaceChanged (1080,2196) 1 #5 io.flutter.embedding.android.FlutterSurfaceView{8dc06f1 V.E...... ......ID 0,0-1080,2196}
I/SurfaceView(31716): 148637425 surfaceRedrawNeeded
I/SurfaceView(31716): 148637425 finishedDrawing
V/SurfaceView@8dc06f1(31716): Layout: x=0 y=0 w=1080 h=2196, frame=Rect(0, 0 - 1080, 2196)
D/ViewRootImpl@d41d647[MainActivity](31716): reportNextDraw android.view.ViewRootImpl.performTraversals:4781 android.view.ViewRootImpl.doTraversal:3345 android.view.ViewRootImpl$TraversalRunnable.run:11437 android.view.Choreographer$CallbackRecord.run:1690 android.view.Choreographer$CallbackRecord.run:1699
I/ViewRootImpl@d41d647[MainActivity](31716): Setup new sync=wmsSync-ViewRootImpl@d41d647[MainActivity]#18
I/ViewRootImpl@d41d647[MainActivity](31716): Creating new active sync group ViewRootImpl@d41d647[MainActivity]#19
I/SurfaceSyncGroup(31716): addLocalSync=ViewRootImpl@d41d647[MainActivity]#19 to name=wmsSync-ViewRootImpl@d41d647[MainActivity]#18, callers=android.window.SurfaceSyncGroup.add:431 android.window.SurfaceSyncGroup.add:392 android.window.SurfaceSyncGroup.add:340 android.view.ViewRootImpl.createSyncIfNeeded:4912 android.view.ViewRootImpl.performTraversals:4796 android.view.ViewRootImpl.doTraversal:3345
I/ViewRootImpl@d41d647[MainActivity](31716): registerCallbacksForSync syncBuffer=false
D/SurfaceView(31716): 148637425 updateSurfacePosition RenderWorker, frameNr = 4, position = [0, 0, 1080, 2196] surfaceSize = 1080x2196
I/SurfaceView@8dc06f1(31716): uSP: rtp = Rect(0, 0 - 1080, 2196) rtsw = 1080 rtsh = 2196
I/SurfaceView@8dc06f1(31716): onSSPAndSRT: pl = 0 pt = 0 sx = 1.0 sy = 1.0
I/SurfaceView@8dc06f1(31716): aOrMT: ViewRootImpl@d41d647[MainActivity] t = android.view.SurfaceControl$Transaction@6741642 fN = 4 android.view.SurfaceView.-$$Nest$mapplyOrMergeTransaction:0 android.view.SurfaceView$SurfaceViewPositionUpdateListener.positionChanged:1667 android.graphics.RenderNode$CompositePositionUpdateListener.positionChanged:369
I/ViewRootImpl@d41d647[MainActivity](31716): mWNT: t=0xb4000071ef0024d0 mBlastBufferQueue=0xb4000071fefd8830 fn= 4 mRenderHdrSdrRatio=1.0 caller= android.view.SurfaceView.applyOrMergeTransaction:1599 android.view.SurfaceView.-$$Nest$mapplyOrMergeTransaction:0 android.view.SurfaceView$SurfaceViewPositionUpdateListener.positionChanged:1667
I/ViewRootImpl@d41d647[MainActivity](31716): Received frameDrawingCallback syncResult=0 frameNum=4.
I/ViewRootImpl@d41d647[MainActivity](31716): mWNT: t=0xb4000071ef01a890 mBlastBufferQueue=0xb4000071fefd8830 fn= 4 mRenderHdrSdrRatio=1.0 caller= android.view.ViewRootImpl$8.onFrameDraw:13946 android.view.ThreadedRenderer$1.onFrameDraw:792 <bottom of call stack>
I/ViewRootImpl@d41d647[MainActivity](31716): Setting up sync and frameCommitCallback
I/ViewRootImpl@d41d647[MainActivity](31716): Received frameCommittedCallback lastAttemptedDrawFrameNum=4 didProduceBuffer=true
I/SurfaceSyncGroup(31716): onTransactionReady mName=wmsSync-ViewRootImpl@d41d647[MainActivity]#18 callback=23388452
I/ViewRootImpl@d41d647[MainActivity](31716): reportDrawFinished seqId=5
V/ViewRootImpl@d41d647[MainActivity](31716): updateAppliedLetterboxDirection, direction=0, Caller=android.view.ViewRootImpl.handleDispatchLetterboxDirectionChanged:14266
I/ViewRootImpl@d41d647[MainActivity](31716): handleResized, msg = 5 frames=ClientWindowFrames{frame=[0,0][1080,2340] display=[0,0][1080,2340] parentFrame=[0,0][0,0]} forceNextWindowRelayout=false displayId=0 dragResizing=false compatScale=1.0 frameChanged=false attachedFrameChanged=false configChanged=false displayChanged=false compatScaleChanged=false
I/ViewRootImpl@d41d647[MainActivity](31716): handleResized mSyncSeqId = 5
D/ViewRootImpl@d41d647[MainActivity](31716): reportNextDraw android.view.ViewRootImpl.handleResized:2574 android.view.ViewRootImpl.-$$Nest$mhandleResized:0 android.view.ViewRootImpl$ViewRootHandler.handleMessageImpl:7267 android.view.ViewRootImpl$ViewRootHandler.handleMessage:7236 android.os.Handler.dispatchMessage:106
I/ViewRootImpl@d41d647[MainActivity](31716): Setup new sync=wmsSync-ViewRootImpl@d41d647[MainActivity]#20
I/ViewRootImpl@d41d647[MainActivity](31716): Creating new active sync group ViewRootImpl@d41d647[MainActivity]#21
I/SurfaceSyncGroup(31716): addLocalSync=ViewRootImpl@d41d647[MainActivity]#21 to name=wmsSync-ViewRootImpl@d41d647[MainActivity]#20, callers=android.window.SurfaceSyncGroup.add:431 android.window.SurfaceSyncGroup.add:392 android.window.SurfaceSyncGroup.add:340 android.view.ViewRootImpl.createSyncIfNeeded:4912 android.view.ViewRootImpl.performTraversals:4796 android.view.ViewRootImpl.doTraversal:3345
I/ViewRootImpl@d41d647[MainActivity](31716): registerCallbacksForSync syncBuffer=false
I/ViewRootImpl@d41d647[MainActivity](31716): Received frameDrawingCallback syncResult=0 frameNum=5.
I/ViewRootImpl@d41d647[MainActivity](31716): mWNT: t=0xb4000071ef00f890 mBlastBufferQueue=0xb4000071fefd8830 fn= 5 mRenderHdrSdrRatio=1.0 caller= android.view.ViewRootImpl$8.onFrameDraw:13946 android.view.ThreadedRenderer$1.onFrameDraw:792 <bottom of call stack>
I/ViewRootImpl@d41d647[MainActivity](31716): Setting up sync and frameCommitCallback
I/ViewRootImpl@d41d647[MainActivity](31716): Received frameCommittedCallback lastAttemptedDrawFrameNum=5 didProduceBuffer=true
I/SurfaceSyncGroup(31716): onTransactionReady mName=wmsSync-ViewRootImpl@d41d647[MainActivity]#20 callback=95050889
I/ViewRootImpl@d41d647[MainActivity](31716): reportDrawFinished seqId=5
I/InsetsSourceConsumer(31716): applyRequestedVisibilityToControl: visible=true, type=navigationBars, host=com.example.camera_poc/com.example.camera_poc.MainActivity
I/ViewRootImpl@d41d647[MainActivity](31716): mWNT: t=0xb4000071ef017df0 mBlastBufferQueue=0xb4000071fefd8830 fn= 6 mRenderHdrSdrRatio=1.0 caller= android.view.SyncRtSurfaceTransactionApplier.applyTransaction:96 android.view.SyncRtSurfaceTransactionApplier.lambda$scheduleApply$0:69 android.view.SyncRtSurfaceTransactionApplier.$r8$lambda$SgowXC58rj3PR958kHUfRgLZmvE:0
════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown while applying parent data.:
Incorrect use of ParentDataWidget.
The ParentDataWidget Expanded(flex: 1) wants to apply ParentData of type FlexParentData to a RenderObject, which has been set up to accept ParentData of incompatible type StackParentData.
Usually, this means that the Expanded widget has the wrong ancestor RenderObjectWidget. Typically, Expanded widgets are placed directly inside Flex widgets.
The offending Expanded is currently placed inside a Stack widget.
I/CameraManagerGlobal(31716): Camera 0 facing CAMERA_FACING_BACK state now CAMERA_STATE_IDLE for client com.example.camera_poc API Level 2 User Id 0
2
D/CameraOrientationUtil(31716): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/DynamicRangeResolver(31716): Resolved dynamic range for use case androidx.camera.core.Preview-4b53d6ce-252f-4dc1-86b5-6605802cfb54 to no compatible HDR dynamic ranges.
D/DynamicRangeResolver(31716): DynamicRange@5d995b5{encoding=UNSPECIFIED, bitDepth=0}
D/DynamicRangeResolver(31716): ->
D/DynamicRangeResolver(31716): DynamicRange@d89ddec{encoding=SDR, bitDepth=8}
D/CameraOrientationUtil(31716): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/DeferrableSurface(31716): Surface created[total_surfaces=5, used_surfaces=4](androidx.camera.core.processing.SurfaceEdge$SettableSurface@f6286a1}
D/DeferrableSurface(31716): Surface created[total_surfaces=6, used_surfaces=4](androidx.camera.core.SurfaceRequest$2@27febdd}
D/DeferrableSurface(31716): New surface in use[total_surfaces=6, used_surfaces=5](androidx.camera.core.SurfaceRequest$2@27febdd}
D/DeferrableSurface(31716): use count+1, useCount=1 androidx.camera.core.SurfaceRequest$2@27febdd
D/CameraOrientationUtil(31716): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/ImageCapture(31716): createPipeline(cameraId: 0, streamSpec: StreamSpec{resolution=640x480, dynamicRange=DynamicRange@d89ddec{encoding=SDR, bitDepth=8}, expectedFrameRateRange=[0, 0], implementationOptions=androidx.camera.camera2.impl.Camera2ImplConfig@41468d9})
D/DeferrableSurface(31716): Surface created[total_surfaces=7, used_surfaces=5](androidx.camera.core.impl.ImmediateSurface@578f29e}
2
D/CameraOrientationUtil(31716): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/DeferrableSurface(31716): Surface created[total_surfaces=8, used_surfaces=5](androidx.camera.core.impl.ImmediateSurface@866a54c}
I/ViewRootImpl@d41d647[MainActivity](31716): onDisplayChanged oldDisplayState=2 newDisplayState=2
D/CameraOrientationUtil(31716): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
════════ Exception caught by widgets library ═══════════════════════════════════
Incorrect use of ParentDataWidget.
════════════════════════════════════════════════════════════════════════════════
4
I/CameraManagerGlobal(31716): postSingleUpdate device: camera id 0 status STATUS_PRESENT
W/mple.camera_poc(31716): Long monitor contention with owner CameraX-core_camera_2 (31876) at void android.hardware.camera2.impl.CameraDeviceImpl.close()(CameraDeviceImpl.java:1492) waiters=0 in void android.hardware.camera2.impl.CameraDeviceImpl$CameraDeviceCallbacks.onResultReceived(android.hardware.camera2.impl.CameraMetadataNative, android.hardware.camera2.impl.CaptureResultExtras, android.hardware.camera2.impl.PhysicalCaptureResultInfo[]) for 320ms
D/UseCaseAttachState(31716): Active and attached use case: [] for camera: 0
D/Camera2CameraImpl(31716): {Camera@b5c316e[id=0]} Use case androidx.camera.core.ImageCapture-69ee94e3-b971-4227-ad2d-5c180a55a3f4205774242 ACTIVE
D/UseCaseAttachState(31716): Active and attached use case: [] for camera: 0
D/Camera2CameraImpl(31716): {Camera@b5c316e[id=0]} Use case androidx.camera.core.Preview-4b53d6ce-252f-4dc1-86b5-6605802cfb54224525630 ACTIVE
D/UseCaseAttachState(31716): Active and attached use case: [] for camera: 0
D/Camera2CameraImpl(31716): {Camera@b5c316e[id=0]} Use case androidx.camera.core.ImageCapture-69ee94e3-b971-4227-ad2d-5c180a55a3f4205774242 ACTIVE
D/UseCaseAttachState(31716): Active and attached use case: [] for camera: 0
D/Camera2CameraImpl(31716): {Camera@b5c316e[id=0]} Use case androidx.camera.core.ImageAnalysis-ef07e375-2fdc-46b2-8426-3da305928fd659339248 INACTIVE
I/CameraManagerGlobal(31716): Camera 0 facing CAMERA_FACING_BACK state now CAMERA_STATE_CLOSED for client com.example.camera_poc API Level 2 User Id 0
2
D/UseCaseAttachState(31716): Active and attached use case: [] for camera: 0
D/Camera2CameraImpl(31716): {Camera@b5c316e[id=0]} Use cases [androidx.camera.core.Preview-4b53d6ce-252f-4dc1-86b5-6605802cfb54224525630, androidx.camera.core.ImageCapture-69ee94e3-b971-4227-ad2d-5c180a55a3f4205774242, androidx.camera.core.ImageAnalysis-ef07e375-2fdc-46b2-8426-3da305928fd659339248] now ATTACHED
D/UseCaseAttachState(31716): All use case: [androidx.camera.core.ImageCapture-69ee94e3-b971-4227-ad2d-5c180a55a3f4205774242, androidx.camera.core.Preview-4b53d6ce-252f-4dc1-86b5-6605802cfb54224525630, androidx.camera.core.ImageAnalysis-ef07e375-2fdc-46b2-8426-3da305928fd659339248] for camera: 0
D/UseCaseAttachState(31716): Active and attached use case: [androidx.camera.core.ImageCapture-69ee94e3-b971-4227-ad2d-5c180a55a3f4205774242, androidx.camera.core.Preview-4b53d6ce-252f-4dc1-86b5-6605802cfb54224525630] for camera: 0
D/Camera2CameraImpl(31716): {Camera@b5c316e[id=0]} Resetting Capture Session
D/Camera2CameraImpl(31716): {Camera@b5c316e[id=0]} Releasing session in state CLOSING
D/Camera2CameraImpl(31716): {Camera@b5c316e[id=0]} Transitioning camera internal state: CLOSING --> REOPENING
D/CameraStateRegistry(31716): Recalculating open cameras:
D/CameraStateRegistry(31716): Camera State
D/CameraStateRegistry(31716): -------------------------------------------------------------------
D/CameraStateRegistry(31716): Camera@b5c316e[id=0] OPENING
D/CameraStateRegistry(31716): Camera@6dd21e[id=2] UNKNOWN
D/CameraStateRegistry(31716): Camera@6283791[id=3] UNKNOWN
D/CameraStateRegistry(31716): Camera@15aa207[id=1] UNKNOWN
D/CameraStateRegistry(31716): -------------------------------------------------------------------
D/CameraStateRegistry(31716): Open count: 1 (Max allowed: 1)
D/CameraStateMachine(31716): New public camera state CameraState{type=OPENING, error=null} from OPENING and null
D/CameraStateMachine(31716): Publishing new public camera state CameraState{type=OPENING, error=null}
D/Camera2CameraImpl(31716): {Camera@b5c316e[id=0]} Use case androidx.camera.core.Preview-4b53d6ce-252f-4dc1-86b5-6605802cfb54224525630 ACTIVE
D/UseCaseAttachState(31716): Active and attached use case: [androidx.camera.core.ImageCapture-69ee94e3-b971-4227-ad2d-5c180a55a3f4205774242, androidx.camera.core.Preview-4b53d6ce-252f-4dc1-86b5-6605802cfb54224525630] for camera: 0
D/Camera2CameraImpl(31716): {Camera@b5c316e[id=0]} Use case androidx.camera.core.ImageCapture-69ee94e3-b971-4227-ad2d-5c180a55a3f4205774242 ACTIVE
D/UseCaseAttachState(31716): Active and attached use case: [androidx.camera.core.ImageCapture-69ee94e3-b971-4227-ad2d-5c180a55a3f4205774242, androidx.camera.core.Preview-4b53d6ce-252f-4dc1-86b5-6605802cfb54224525630] for camera: 0
E/ObserverFlutterApi(31716): The Observer that received a callback has been garbage collected. Please create a new instance to receive any further data changes.
D/Camera2CameraImpl(31716): {Camera@b5c316e[id=0]} Use case androidx.camera.core.ImageAnalysis-ef07e375-2fdc-46b2-8426-3da305928fd659339248 INACTIVE
D/UseCaseAttachState(31716): Active and attached use case: [androidx.camera.core.ImageCapture-69ee94e3-b971-4227-ad2d-5c180a55a3f4205774242, androidx.camera.core.Preview-4b53d6ce-252f-4dc1-86b5-6605802cfb54224525630] for camera: 0
D/DeferrableSurface(31716): use count-1, useCount=0 closed=true androidx.camera.core.processing.SurfaceEdge$SettableSurface@5ade588
D/DeferrableSurface(31716): Surface no longer in use[total_surfaces=8, used_surfaces=4](androidx.camera.core.processing.SurfaceEdge$SettableSurface@5ade588}
D/DeferrableSurface(31716): Surface terminated[total_surfaces=7, used_surfaces=4](androidx.camera.core.processing.SurfaceEdge$SettableSurface@5ade588}
D/DeferrableSurface(31716): use count-1, useCount=0 closed=false androidx.camera.core.SurfaceRequest$2@cffd234
D/DeferrableSurface(31716): Surface no longer in use[total_surfaces=7, used_surfaces=3](androidx.camera.core.SurfaceRequest$2@cffd234}
D/DeferrableSurface(31716): surface closed, useCount=0 closed=true androidx.camera.core.SurfaceRequest$2@cffd234
D/DeferrableSurface(31716): Surface terminated[total_surfaces=6, used_surfaces=3](androidx.camera.core.SurfaceRequest$2@cffd234}
D/DeferrableSurface(31716): use count-1, useCount=0 closed=true androidx.camera.core.impl.ImmediateSurface@8724d59
D/DeferrableSurface(31716): Surface no longer in use[total_surfaces=6, used_surfaces=2](androidx.camera.core.impl.ImmediateSurface@8724d59}
D/DeferrableSurface(31716): Surface terminated[total_surfaces=5, used_surfaces=2](androidx.camera.core.impl.ImmediateSurface@8724d59}
D/DeferrableSurface(31716): use count-1, useCount=0 closed=true androidx.camera.core.impl.ImmediateSurface@19759ff
D/DeferrableSurface(31716): Surface no longer in use[total_surfaces=5, used_surfaces=1](androidx.camera.core.impl.ImmediateSurface@19759ff}
D/DeferrableSurface(31716): Surface terminated[total_surfaces=4, used_surfaces=1](androidx.camera.core.impl.ImmediateSurface@19759ff}
D/Camera2CameraImpl(31716): {Camera@b5c316e[id=0]} CameraDevice.onClosed()
D/Camera2CameraImpl(31716): {Camera@b5c316e[id=0]} Attempting to open the camera.
D/CameraStateRegistry(31716): tryOpenCamera(Camera@b5c316e[id=0]) [Available Cameras: 0, Already Open: true (Previous state: OPENING)] --> SUCCESS
D/CameraStateRegistry(31716): Recalculating open cameras:
D/CameraStateRegistry(31716): Camera State
D/CameraStateRegistry(31716): -------------------------------------------------------------------
D/CameraStateRegistry(31716): Camera@b5c316e[id=0] OPENING
D/CameraStateRegistry(31716): Camera@6dd21e[id=2] UNKNOWN
D/CameraStateRegistry(31716): Camera@6283791[id=3] UNKNOWN
D/CameraStateRegistry(31716): Camera@15aa207[id=1] UNKNOWN
D/CameraStateRegistry(31716): -------------------------------------------------------------------
D/CameraStateRegistry(31716): Open count: 1 (Max allowed: 1)
D/Camera2CameraImpl(31716): {Camera@b5c316e[id=0]} Opening camera.
D/Camera2CameraImpl(31716): {Camera@b5c316e[id=0]} Transitioning camera internal state: REOPENING --> OPENING
D/CameraStateMachine(31716): New public camera state CameraState{type=OPENING, error=null} from OPENING and null
D/UseCaseAttachState(31716): All use case: [androidx.camera.core.ImageCapture-69ee94e3-b971-4227-ad2d-5c180a55a3f4205774242, androidx.camera.core.Preview-4b53d6ce-252f-4dc1-86b5-6605802cfb54224525630, androidx.camera.core.ImageAnalysis-ef07e375-2fdc-46b2-8426-3da305928fd659339248] for camera: 0
════════ Exception caught by widgets library ═══════════════════════════════════
Incorrect use of ParentDataWidget.
════════════════════════════════════════════════════════════════════════════════
I/CameraManagerGlobal(31716): Camera 0 facing CAMERA_FACING_BACK state now CAMERA_STATE_OPENING for client com.example.camera_poc API Level 2 User Id 0
4
I/CameraManagerGlobal(31716): postSingleUpdate device: camera id 0 status STATUS_NOT_AVAILABLE
I/CameraManagerGlobal(31716): Camera 0 facing CAMERA_FACING_BACK state now CAMERA_STATE_OPEN for client com.example.camera_poc API Level 2 User Id 0
D/Camera2CameraImpl(31716): {Camera@b5c316e[id=0]} CameraDevice.onOpened()
D/Camera2CameraImpl(31716): {Camera@b5c316e[id=0]} Transitioning camera internal state: OPENING --> OPENED
D/CameraStateRegistry(31716): Recalculating open cameras:
D/CameraStateRegistry(31716): Camera State
D/CameraStateRegistry(31716): -------------------------------------------------------------------
D/CameraStateRegistry(31716): Camera@b5c316e[id=0] OPEN
D/CameraStateRegistry(31716): Camera@6dd21e[id=2] UNKNOWN
D/CameraStateRegistry(31716): Camera@6283791[id=3] UNKNOWN
D/CameraStateRegistry(31716): Camera@15aa207[id=1] UNKNOWN
D/CameraStateRegistry(31716): -------------------------------------------------------------------
D/CameraStateRegistry(31716): Open count: 1 (Max allowed: 1)
D/CameraStateMachine(31716): New public camera state CameraState{type=OPEN, error=null} from OPEN and null
D/CameraStateMachine(31716): Publishing new public camera state CameraState{type=OPEN, error=null}
D/UseCaseAttachState(31716): All use case: [androidx.camera.core.ImageCapture-69ee94e3-b971-4227-ad2d-5c180a55a3f4205774242, androidx.camera.core.Preview-4b53d6ce-252f-4dc1-86b5-6605802cfb54224525630, androidx.camera.core.ImageAnalysis-ef07e375-2fdc-46b2-8426-3da305928fd659339248] for camera: 0
E/ObserverFlutterApi(31716): The Observer that received a callback has been garbage collected. Please create a new instance to receive any further data changes.
D/UseCaseAttachState(31716): Active and attached use case: [androidx.camera.core.ImageCapture-69ee94e3-b971-4227-ad2d-5c180a55a3f4205774242, androidx.camera.core.Preview-4b53d6ce-252f-4dc1-86b5-6605802cfb54224525630] for camera: 0
D/SyncCaptureSessionBase(31716): [androidx.camera.camera2.internal.SynchronizedCaptureSessionBaseImpl@fcdc757] getSurface...done
D/CaptureSession(31716): Opening capture session.
D/DeferrableSurface(31716): New surface in use[total_surfaces=4, used_surfaces=2](androidx.camera.core.processing.SurfaceEdge$SettableSurface@f6286a1}
D/DeferrableSurface(31716): use count+1, useCount=1 androidx.camera.core.processing.SurfaceEdge$SettableSurface@f6286a1
D/DeferrableSurface(31716): New surface in use[total_surfaces=4, used_surfaces=3](androidx.camera.core.impl.ImmediateSurface@578f29e}
D/DeferrableSurface(31716): use count+1, useCount=1 androidx.camera.core.impl.ImmediateSurface@578f29e
D/DeferrableSurface(31716): New surface in use[total_surfaces=4, used_surfaces=4](androidx.camera.core.impl.ImmediateSurface@866a54c}
D/DeferrableSurface(31716): use count+1, useCount=1 androidx.camera.core.impl.ImmediateSurface@866a54c
D/CaptureSession(31716): Attempting to send capture request onConfigured
D/CaptureSession(31716): Issuing request for session.
D/Camera2CaptureRequestBuilder(31716): createCaptureRequest
D/CaptureSession(31716): CameraCaptureSession.onConfigured() mState=OPENED
D/CaptureSession(31716): CameraCaptureSession.onReady() OPENED
I/CameraManagerGlobal(31716): Camera 0 facing CAMERA_FACING_BACK state now CAMERA_STATE_ACTIVE for client com.example.camera_poc API Level 2 User Id 0
2
I/ViewRootImpl@d41d647[MainActivity](31716): onDisplayChanged oldDisplayState=2 newDisplayState=2
9
I/mple.camera_poc(31716): EglImage dataspace changed, need recreate
V/ViewRootImpl@d41d647[MainActivity](31716): updateAppliedLetterboxDirection, direction=1, Caller=android.view.ViewRootImpl.handleDispatchLetterboxDirectionChanged:14266
I/ViewRootImpl@d41d647[MainActivity](31716): Resizing android.view.ViewRootImpl@c752230: frame = [81,0][2340,1080] reportDraw = true forceLayout = false syncSeqId = -1
I/InsetsController(31716): onStateChanged: host=com.example.camera_poc/com.example.camera_poc.MainActivity, from=android.view.ViewRootImpl.relayoutWindow:10165, state=InsetsState: {mDisplayFrame=Rect(0, 0 - 2340, 1080), mDisplayCutout=DisplayCutout{insets=Rect(81, 0 - 0, 0) waterfall=Insets{left=0, top=0, right=0, bottom=0} boundingRect={Bounds=[Rect(0, 512 - 81, 568), Rect(0, 0 - 0, 0), Rect(0, 0 - 0, 0), Rect(0, 0 - 0, 0)]} cutoutPathParserInfo={CutoutPathParserInfo{displayWidth=1080 displayHeight=2340 physicalDisplayWidth=1080 physicalDisplayHeight=2340 density={3.0} cutoutSpec={M 0,0 H -9.333333333333333 V 27 H 9.333333333333333 V 0 H 0 Z @dp} rotation={1} scale={1.0} physicalPixelDisplaySizeRatio={1.0}}}}, mRoundedCorners=RoundedCorners{[RoundedCorner{position=TopLeft, radius=102, center=Point(102, 102)}, RoundedCorner{position=TopRight, radius=102, center=Point(2238, 102)}, RoundedCorner{position=BottomRight, radius=102, center=Point(2238, 978)}, RoundedCorner{position=BottomLeft, radius=102, center=Point(102, 978)}]} mRoundedCornerFrame=Rect(0, 0 - 2340, 1080), mPrivacyIndicatorBounds=PrivacyIndicatorBounds {static bounds=Rect(2208, 0 - 2340, 72) rotation=1}, mDisplayShape=DisplayShape{ spec=-311912193 displayWidth=1080 displayHeight=2340 physicalPixelDisplaySizeRatio=1.0 rotation=1 offsetX=0 offsetY=0 scale=1.0}, mSources= { InsetsSource: {b40b0001 mType=navigationBars mFrame=[2196,0][2340,1080] mVisible=true mFlags=[]}, InsetsSource: {b40b0004 mType=systemGestures mFrame=[0,0][0,0] mVisible=true mFlags=[]}, InsetsSource: {b40b0005 mType=mandatorySystemGestures mFrame=[2196,0][2340,1080] mVisible=true mFlags=[]}, InsetsSource: {b40b0006 mType=tappableElement mFrame=[2196,0][2340,1080] mVisible=true mFlags=[]}, InsetsSource: {b40b0024 mType=systemGestures mFrame=[0,0][0,0] mVisible=true mFlags=[]}, InsetsSource: {3 mType=ime mFrame=[0,0][0,0] mVisible=false mFlags=[]}, InsetsSource: {7 mType=displayCutout mFrame=[0,0][81,1080] mVisible=true mFlags=[]}, InsetsSource: {6f210000 mType=statusBars mFrame=[0,0][2340,72] mVisible=true mFlags=[]}, InsetsSource: {6f210005 mType=mandatorySystemGestures mFrame=[0,0][2340,72] mVisible=true mFlags=[]}, InsetsSource: {6f210006 mType=tappableElement mFrame=[0,0][2340,72] mVisible=true mFlags=[]} }
I/InsetsSourceConsumer(31716): applyRequestedVisibilityToControl: visible=true, type=statusBars, host=com.example.camera_poc/com.example.camera_poc.MainActivity
I/InsetsSourceConsumer(31716): applyRequestedVisibilityToControl: visible=true, type=navigationBars, host=com.example.camera_poc/com.example.camera_poc.MainActivity
I/BLASTBufferQueue_Java(31716): update, w= 2259 h= 1080 mName = ViewRootImpl@d41d647[MainActivity] mNativeObject= 0xb4000071fefd8830 sc.mNativeObject= 0xb40000717efcc9d0 format= -3 caller= android.view.ViewRootImpl.updateBlastSurfaceIfNeeded:3074 android.view.ViewRootImpl.relayoutWindow:10224 android.view.ViewRootImpl.performTraversals:4167 android.view.ViewRootImpl.doTraversal:3345 android.view.ViewRootImpl$TraversalRunnable.run:11437 android.view.Choreographer$CallbackRecord.run:1690
I/ViewRootImpl@d41d647[MainActivity](31716): Relayout returned: old=(0,0,1080,2340) new=(81,0,2340,1080) relayoutAsync=false req=(1080,2340)0 dur=10 res=0x401 s={true 0xb4000070aeff3d70} ch=false seqId=5
D/ViewRootImpl@d41d647[MainActivity](31716): mThreadedRenderer.updateSurface() mSurface={isValid=true 0xb4000070aeff3d70}
I/ViewRootImpl@d41d647[MainActivity](31716): updateBoundsLayer: t=android.view.SurfaceControl$Transaction@c223856 sc=Surface(name=Bounds for - com.example.camera_poc/com.example.camera_poc.MainActivity@1)/@0xcee64b6 frame=7
I/SurfaceView(31716): 148637425 Changes: creating=false format=false size=true visible=false alpha=false hint=true visible=false left=false top=false z=false attached=true lifecycleStrategy=false
I/SurfaceView@8dc06f1(31716): 148637425 Cur surface: Surface(name=null)/@0xdd6bb72
I/BLASTBufferQueue_Java(31716): update, w= 2115 h= 1080 mName = null mNativeObject= 0xb4000071fefd7ed0 sc.mNativeObject= 0xb40000717eff0250 format= 4 caller= android.view.SurfaceView.setBufferSize:1439 android.view.SurfaceView.performSurfaceTransaction:995 android.view.SurfaceView.updateSurface:1211 android.view.SurfaceView.setFrame:559 android.view.View.layout:25782 android.widget.FrameLayout.layoutChildren:332
I/SurfaceView@8dc06f1(31716): pST: sr = Rect(0, 0 - 2115, 1080) sw = 2115 sh = 1080
D/SurfaceView@8dc06f1(31716): 148637425 performSurfaceTransaction RenderWorker position = [0, 0, 2115, 1080] surfaceSize = 2115x1080
I/SurfaceView@8dc06f1(31716): updateSurface: mVisible = true mSurface.isValid() = true
I/SurfaceView@8dc06f1(31716): updateSurface: mSurfaceCreated = true surfaceChanged = false visibleChanged = false
I/SurfaceView(31716): 148637425 surfaceChanged -- format=4 w=2115 h=1080
I/SurfaceView@8dc06f1(31716): surfaceChanged (2115,1080) 1 #5 io.flutter.embedding.android.FlutterSurfaceView{8dc06f1 V.E...... ......ID 0,0-2115,1080}
I/SurfaceView(31716): 148637425 surfaceRedrawNeeded
I/SurfaceView(31716): 148637425 finishedDrawing
V/SurfaceView@8dc06f1(31716): Layout: x=0 y=0 w=2115 h=1080, frame=Rect(0, 0 - 2115, 1080)
D/ViewRootImpl@d41d647[MainActivity](31716): reportNextDraw android.view.ViewRootImpl.performTraversals:4781 android.view.ViewRootImpl.doTraversal:3345 android.view.ViewRootImpl$TraversalRunnable.run:11437 android.view.Choreographer$CallbackRecord.run:1690 android.view.Choreographer$CallbackRecord.run:1699
I/ViewRootImpl@d41d647[MainActivity](31716): Setup new sync=wmsSync-ViewRootImpl@d41d647[MainActivity]#23
I/ViewRootImpl@d41d647[MainActivity](31716): Creating new active sync group ViewRootImpl@d41d647[MainActivity]#24
I/SurfaceSyncGroup(31716): addLocalSync=ViewRootImpl@d41d647[MainActivity]#24 to name=wmsSync-ViewRootImpl@d41d647[MainActivity]#23, callers=android.window.SurfaceSyncGroup.add:431 android.window.SurfaceSyncGroup.add:392 android.window.SurfaceSyncGroup.add:340 android.view.ViewRootImpl.createSyncIfNeeded:4912 android.view.ViewRootImpl.performTraversals:4796 android.view.ViewRootImpl.doTraversal:3345
I/ViewRootImpl@d41d647[MainActivity](31716): registerCallbacksForSync syncBuffer=false
D/SurfaceView(31716): 148637425 updateSurfacePosition RenderWorker, frameNr = 7, position = [0, 0, 2115, 1080] surfaceSize = 2115x1080
I/SurfaceView@8dc06f1(31716): uSP: rtp = Rect(0, 0 - 2115, 1080) rtsw = 2115 rtsh = 1080
I/SurfaceView@8dc06f1(31716): onSSPAndSRT: pl = 0 pt = 0 sx = 1.0 sy = 1.0
I/SurfaceView@8dc06f1(31716): aOrMT: ViewRootImpl@d41d647[MainActivity] t = android.view.SurfaceControl$Transaction@b11b5ba fN = 7 android.view.SurfaceView.-$$Nest$mapplyOrMergeTransaction:0 android.view.SurfaceView$SurfaceViewPositionUpdateListener.positionChanged:1667 android.graphics.RenderNode$CompositePositionUpdateListener.positionChanged:369
I/ViewRootImpl@d41d647[MainActivity](31716): mWNT: t=0xb4000071ef019810 mBlastBufferQueue=0xb4000071fefd8830 fn= 7 mRenderHdrSdrRatio=1.0 caller= android.view.SurfaceView.applyOrMergeTransaction:1599 android.view.SurfaceView.-$$Nest$mapplyOrMergeTransaction:0 android.view.SurfaceView$SurfaceViewPositionUpdateListener.positionChanged:1667
I/ViewRootImpl@d41d647[MainActivity](31716): Received frameDrawingCallback syncResult=0 frameNum=7.
I/ViewRootImpl@d41d647[MainActivity](31716): mWNT: t=0xb4000071ef000110 mBlastBufferQueue=0xb4000071fefd8830 fn= 7 mRenderHdrSdrRatio=1.0 caller= android.view.ViewRootImpl$8.onFrameDraw:13946 android.view.ThreadedRenderer$1.onFrameDraw:792 <bottom of call stack>
I/ViewRootImpl@d41d647[MainActivity](31716): Setting up sync and frameCommitCallback
I/ViewRootImpl@d41d647[MainActivity](31716): Received frameCommittedCallback lastAttemptedDrawFrameNum=7 didProduceBuffer=true
I/SurfaceSyncGroup(31716): onTransactionReady mName=wmsSync-ViewRootImpl@d41d647[MainActivity]#23 callback=107235919
I/ViewRootImpl@d41d647[MainActivity](31716): reportDrawFinished seqId=5
I/ViewRootImpl@d41d647[MainActivity](31716): handleResized, msg = 5 frames=ClientWindowFrames{frame=[81,0][2340,1080] display=[81,0][2340,1080] parentFrame=[0,0][0,0]} forceNextWindowRelayout=false displayId=0 dragResizing=false compatScale=1.0 frameChanged=false attachedFrameChanged=false configChanged=false displayChanged=false compatScaleChanged=false
I/ViewRootImpl@d41d647[MainActivity](31716): handleResized mSyncSeqId = 5
D/ViewRootImpl@d41d647[MainActivity](31716): reportNextDraw android.view.ViewRootImpl.handleResized:2574 android.view.ViewRootImpl.-$$Nest$mhandleResized:0 android.view.ViewRootImpl$ViewRootHandler.handleMessageImpl:7267 android.view.ViewRootImpl$ViewRootHandler.handleMessage:7236 android.os.Handler.dispatchMessage:106
I/ViewRootImpl@d41d647[MainActivity](31716): onDisplayChanged oldDisplayState=2 newDisplayState=2
I/ViewRootImpl@d41d647[MainActivity](31716): Setup new sync=wmsSync-ViewRootImpl@d41d647[MainActivity]#25
I/ViewRootImpl@d41d647[MainActivity](31716): Creating new active sync group ViewRootImpl@d41d647[MainActivity]#26
I/SurfaceSyncGroup(31716): addLocalSync=ViewRootImpl@d41d647[MainActivity]#26 to name=wmsSync-ViewRootImpl@d41d647[MainActivity]#25, callers=android.window.SurfaceSyncGroup.add:431 android.window.SurfaceSyncGroup.add:392 android.window.SurfaceSyncGroup.add:340 android.view.ViewRootImpl.createSyncIfNeeded:4912 android.view.ViewRootImpl.performTraversals:4796 android.view.ViewRootImpl.doTraversal:3345
I/ViewRootImpl@d41d647[MainActivity](31716): registerCallbacksForSync syncBuffer=false
I/ViewRootImpl@d41d647[MainActivity](31716): Received frameDrawingCallback syncResult=0 frameNum=8.
I/ViewRootImpl@d41d647[MainActivity](31716): mWNT: t=0xb4000071ef01e930 mBlastBufferQueue=0xb4000071fefd8830 fn= 8 mRenderHdrSdrRatio=1.0 caller= android.view.ViewRootImpl$8.onFrameDraw:13946 android.view.ThreadedRenderer$1.onFrameDraw:792 <bottom of call stack>
I/ViewRootImpl@d41d647[MainActivity](31716): Setting up sync and frameCommitCallback
I/ViewRootImpl@d41d647[MainActivity](31716): Received frameCommittedCallback lastAttemptedDrawFrameNum=8 didProduceBuffer=false
I/BLASTBufferQueue_Java(31716): gatherPendingTransactions, mName= ViewRootImpl@d41d647[MainActivity] mNativeObject= 0xb4000071fefd8830 frameNumber= 8 caller= android.view.ViewRootImpl$8.lambda$onFrameDraw$1:14019 android.view.ViewRootImpl$8.$r8$lambda$6frSHsGsDhUEo8Wl9hChpniTVZ0:0 android.view.ViewRootImpl$8$$ExternalSyntheticLambda1.onFrameCommit:9 android.view.ThreadedRenderer$1.lambda$onFrameDraw$0:804 android.view.ThreadedRenderer$1$$ExternalSyntheticLambda0.onFrameCommit:2 <bottom of call stack>
I/SurfaceSyncGroup(31716): onTransactionReady mName=wmsSync-ViewRootImpl@d41d647[MainActivity]#25 callback=131087457
I/ViewRootImpl@d41d647[MainActivity](31716): reportDrawFinished seqId=5
E/qdgralloc(31716): GetSize: Unrecognized pixel format: 0x38
E/Gralloc4(31716): isSupported(1, 1, 56, 1, ...) failed with 5
E/GraphicBufferAllocator(31716): Failed to allocate (4 x 4) layerCount 1 format 56 usage b00: 5
E/AHardwareBuffer(31716): GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), handle=0x0
E/qdgralloc(31716): GetSize: Unrecognized pixel format: 0x3b
E/Gralloc4(31716): isSupported(1, 1, 59, 1, ...) failed with 5
E/GraphicBufferAllocator(31716): Failed to allocate (4 x 4) layerCount 1 format 59 usage b00: 5
E/AHardwareBuffer(31716): GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), handle=0x0
E/qdgralloc(31716): GetSize: Unrecognized pixel format: 0x38
E/Gralloc4(31716): isSupported(1, 1, 56, 1, ...) failed with 5
E/GraphicBufferAllocator(31716): Failed to allocate (4 x 4) layerCount 1 format 56 usage b00: 5
E/AHardwareBuffer(31716): GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), handle=0x0
E/qdgralloc(31716): GetSize: Unrecognized pixel format: 0x3b
E/Gralloc4(31716): isSupported(1, 1, 59, 1, ...) failed with 5
E/GraphicBufferAllocator(31716): Failed to allocate (4 x 4) layerCount 1 format 59 usage b00: 5
E/AHardwareBuffer(31716): GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), handle=0x0
E/Surface (31716): freeAllBuffers: 1 buffers were freed while being dequeued!
════════ Exception caught by widgets library ═══════════════════════════════════
Incorrect use of ParentDataWidget.
════════════════════════════════════════════════════════════════════════════════
I/InsetsSourceConsumer(31716): applyRequestedVisibilityToControl: visible=true, type=navigationBars, host=com.example.camera_poc/com.example.camera_poc.MainActivity
I/ViewRootImpl@d41d647[MainActivity](31716): mWNT: t=0xb4000071ef01ea90 mBlastBufferQueue=0xb4000071fefd8830 fn= 8 mRenderHdrSdrRatio=1.0 caller= android.view.SyncRtSurfaceTransactionApplier.applyTransaction:96 android.view.SyncRtSurfaceTransactionApplier.lambda$scheduleApply$0:69 android.view.SyncRtSurfaceTransactionApplier.$r8$lambda$SgowXC58rj3PR958kHUfRgLZmvE:0
I/ViewRootImpl@d41d647[MainActivity](31716): ViewPostIme pointer 0
I/ViewRootImpl@d41d647[MainActivity](31716): ViewPostIme pointer 1
D/ImageCapture(31716): takePictureInternal
D/CameraOrientationUtil(31716): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/TakePictureManager(31716): Issue the next TakePictureRequest.
════════ Exception caught by widgets library ═══════════════════════════════════
Incorrect use of ParentDataWidget.
════════════════════════════════════════════════════════════════════════════════
D/Camera2CameraImpl(31716): {Camera@b5c316e[id=0]} Issue capture request
D/CaptureSession(31716): Issuing capture request.
D/Camera2CaptureRequestBuilder(31716): createCaptureRequest
D/qdgralloc(31716): GetYUVPlaneInfo: Invalid format passed: 0x21
D/TakePictureManager(31716): Issue the next TakePictureRequest.
D/TakePictureManager(31716): No new request.
════════ Exception caught by widgets library ═══════════════════════════════════
Incorrect use of ParentDataWidget.
══════════════════════════════════════════════════════════════════════════
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.32.1, on macOS 15.5 24F74 darwin-arm64, locale en-US) [428ms]
• Flutter version 3.32.1 on channel stable at /Users/diego/fvm/versions/3.32.1
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision b25305a883 (4 days ago), 2025-05-29 10:40:06 -0700
• Engine revision 1425e5e9ec
• Dart version 3.8.1
• DevTools version 2.45.1
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1) [1,805ms]
• Android SDK at /Users/diego/Library/Android/sdk
• Platform android-35, build-tools 35.0.1
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• 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 16.2) [1,111ms]
• Xcode at /Users/diego/Downloads/Xcode.app/Contents/Developer
• Build 16C5032a
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [10ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.2) [9ms]
• 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.9+0-17.0.9b1087.7-11185874)
[✓] VS Code (version 1.100.2) [7ms]
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.110.0
[✓] Connected device (6 available) [6.2s]
• SM S901U1 (mobile) • R5CT72KN5AN • android-arm64 • Android 14 (API 34)
[✓] Network resources [268ms]
• All expected network resources are available.
• No issues found!