Thanks to visit codestin.com
Credit goes to github.com

Skip to content

camera lib 0.2.8: CameraPreview shows black screen instead of camera preview on some iOS devices, including iPhone XΒ #26567

@idealopamp

Description

@idealopamp

Steps to Reproduce

  1. Run the complete camera example from https://pub.dartlang.org/packages/camera#-example-tab- on iPhone X or iPhone 7 plus (and presumably some other iOS devices, but not iphone 6s, and not iPad).
  2. Click on the first camera to select it.
  3. Preview screen of the camera is all black. Pressing the photo capture button will successfully capture an image (not a black screen). Expected result is that CameraPreview screen should not be all black, and should instead have pixels approximating whatever objects are in front of the device's camera.

A couple relevant notes:

This issue happens in camera versions 0.2.8 and later, but not in 0.2.6 and 0.2.7 (haven't tested earlier versions, but presume also not there).

It's also worth noting that this does not happen for the shorter camera example on https://pub.dartlang.org/packages/camera#-readme-tab- . The difference is that the broken example uses ResolutionPresets.high, while the working example uses ResolutionPresets.medium.

Logs

[  +45 ms] [100%] Installed package build/ios/iphoneos/Runner.app
[ +264 ms] ------ Debug phase ------
[        ] Starting debug of ec55604459969d400ac4f51ddc6def2a7ff12d58 (D221AP, D221AP, uknownos, unkarch) a.k.a. 'Tane's iPhone' connected through USB...
[ +535 ms] [  0%] Looking up developer disk image
[  +52 ms] [ 95%] Developer disk image mounted successfully
[ +903 ms] [100%] Connecting to remote debug server
[        ] -------------------------
[  +33 ms] (lldb) command source -s 0 '/tmp/CD3CA301-E1AC-43F6-96BF-436296499990/fruitstrap-lldb-prep-cmds-ec55604459969d400ac4f51ddc6def2a7ff12d58'
[        ] Executing commands in '/tmp/CD3CA301-E1AC-43F6-96BF-436296499990/fruitstrap-lldb-prep-cmds-ec55604459969d400ac4f51ddc6def2a7ff12d58'.
[        ] (lldb)     platform select remote-ios --sysroot '/Users/michaelnelson/Library/Developer/Xcode/iOS DeviceSupport/12.1.2 (16C101)/Symbols'
[        ]   Platform: remote-ios
[        ]  Connected: no
[        ]   SDK Path: "/Users/michaelnelson/Library/Developer/Xcode/iOS DeviceSupport/12.1.2 (16C101)/Symbols"
[        ] (lldb)     target create "/Users/michaelnelson/Documents/GitHub/flutter/appraisal_supplier_app/build/ios/iphoneos/Runner.app"
[+6074 ms] Current executable set to '/Users/michaelnelson/Documents/GitHub/flutter/appraisal_supplier_app/build/ios/iphoneos/Runner.app' (arm64).
[        ] (lldb)     script fruitstrap_device_app="/private/var/containers/Bundle/Application/069425FF-B047-4ADD-99B5-1EBBA8BA8710/Runner.app"
[        ] (lldb)     script fruitstrap_connect_url="connect://127.0.0.1:62803"
[        ] (lldb)     target modules search-paths add /usr "/Users/michaelnelson/Library/Developer/Xcode/iOS DeviceSupport/12.1.2 (16C101)/Symbols/usr" /System "/Users/michaelnelson/Library/Developer/Xcode/iOS DeviceSupport/12.1.2 (16C101)/Symbols/System" "/private/var/containers/Bundle/Application/069425FF-B047-4ADD-99B5-1EBBA8BA8710" "/Users/michaelnelson/Documents/GitHub/flutter/appraisal_supplier_app/build/ios/iphoneos" "/var/containers/Bundle/Application/069425FF-B047-4ADD-99B5-1EBBA8BA8710" "/Users/michaelnelson/Documents/GitHub/flutter/appraisal_supplier_app/build/ios/iphoneos" /Developer "/Users/michaelnelson/Library/Developer/Xcode/iOS DeviceSupport/12.1.2 (16C101)/Symbols/Developer"
[  +98 ms] (lldb)     command script import "/tmp/CD3CA301-E1AC-43F6-96BF-436296499990/fruitstrap_ec55604459969d400ac4f51ddc6def2a7ff12d58.py"
[  +13 ms] (lldb)     command script add -f fruitstrap_ec55604459969d400ac4f51ddc6def2a7ff12d58.connect_command connect
[        ] (lldb)     command script add -s asynchronous -f fruitstrap_ec55604459969d400ac4f51ddc6def2a7ff12d58.run_command run
[        ] (lldb)     command script add -s asynchronous -f fruitstrap_ec55604459969d400ac4f51ddc6def2a7ff12d58.autoexit_command autoexit
[        ] (lldb)     command script add -s asynchronous -f fruitstrap_ec55604459969d400ac4f51ddc6def2a7ff12d58.safequit_command safequit
[        ] (lldb)     connect
[  +24 ms] (lldb)     run
[ +361 ms] success
[        ] (lldb)     safequit
[ +113 ms] Process 55795 detached
[  +58 ms] Application launched on the device. Waiting for observatory port.
[ +715 ms] [Crashlytics] Version 3.12.0 (136)
[  +53 ms] Observatory URL on device: http://127.0.0.1:57049/
[        ] attempting to forward device port 57049 to host port 1024
[        ] executing: /usr/local/bin/iproxy 1024 57049 ec55604459969d400ac4f51ddc6def2a7ff12d58
[   +8 ms] attempting to forward device port 57049 to host port 1025
[        ] executing: /usr/local/bin/iproxy 1025 57049 ec55604459969d400ac4f51ddc6def2a7ff12d58
[+1008 ms] Forwarded port ForwardedPort HOST:1025 to DEVICE:57049
[        ] Forwarded host port 1025 to device port 57049 for Observatory
[   +2 ms] Installing and launching... (completed)
[   +3 ms] Connecting to service protocol: http://127.0.0.1:1025/
[ +159 ms] Successfully connected to service protocol: http://127.0.0.1:1025/
[   +2 ms] Sending to VM service: getVM({})
[   +5 ms] Result: {type: VM, name: vm, architectureBits: 64, targetCPU: dbc, hostCPU: Unknown, version: 2.1.0-dev.9.4.flutter-f9ebf21297 (Thu Nov 8 23:00:07 2018 +0100) on "ios_dbc", _profilerMode: VM, _nativeZoneMemoryUsage: 0, pid: 55795, startTime: 1547599356793...
[   +3 ms] Sending to VM service: getIsolate({isolateId: isolates/1048716777})
[   +2 ms] Sending to VM service: _flutter.listViews({})
[  +31 ms] Result: {type: Isolate, fixedId: true, id: isolates/1048716777, name: main.dart:main.dart(), number: 1048716777, _originNumber: 1048716777, startTime: 1547599356806, _heaps: {new: {type: HeapSpace, name: new, vmName: Scavenger, collections: 2, avgCollecti...
[   +8 ms] Result: {type: FlutterViewList, views: [{type: FlutterView, id: _flutterView/0x129e077b8, isolate: {type: @Isolate, fixedId: true, id: isolates/1048716777, name: main.dart$main.dart-1048716777, number: 1048716777}}]}
[   +8 ms] DevFS: Creating new filesystem on the device (null)
[        ] Sending to VM service: _createDevFS({fsName: appraisal_supplier_app})
[  +27 ms] Result: {type: FileSystem, name: appraisal_supplier_app, uri: file:///private/var/mobile/Containers/Data/Application/CF2166E2-E688-437A-9C06-909671E21EA1/tmp/appraisal_supplier_app2gIBim/appraisal_supplier_app/}
[        ] DevFS: Created new filesystem on the device (file:///private/var/mobile/Containers/Data/Application/CF2166E2-E688-437A-9C06-909671E21EA1/tmp/appraisal_supplier_app2gIBim/appraisal_supplier_app/)
[   +2 ms] Updating assets
[ +400 ms] Syncing files to device Tane's iPhone...
[   +1 ms] DevFS: Starting sync from LocalDirectory: '/Users/michaelnelson/Documents/GitHub/flutter/appraisal_supplier_app'
[        ] Scanning project files
[   +3 ms] Scanning package files
[ +110 ms] Scanning asset files
[   +4 ms] Scanning for deleted files
[   +8 ms] Compiling dart to kernel with 445 updated files
[   +5 ms] /users/michaelnelson/flutter/bin/cache/dart-sdk/bin/dart /users/michaelnelson/flutter/bin/cache/artifacts/engine/darwin-x64/frontend_server.dart.snapshot --sdk-root /users/michaelnelson/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk/ --incremental --strong --target=flutter --output-dill build/app.dill --packages /Users/michaelnelson/Documents/GitHub/flutter/appraisal_supplier_app/.packages --filesystem-scheme org-dartlang-root
[+1015 ms] Updating files
[+1023 ms] DevFS: Sync finished
[        ] Syncing files to device Tane's iPhone... (completed)
[        ] Synced 27.4MB.
[        ] Sending to VM service: _flutter.listViews({})
[   +3 ms] Result: {type: FlutterViewList, views: [{type: FlutterView, id: _flutterView/0x129e077b8, isolate: {type: @Isolate, fixedId: true, id: isolates/1048716777, name: main.dart$main.dart-1048716777, number: 1048716777}}]}
[        ] Connected to _flutterView/0x129e077b8.
[   +1 ms] πŸ”₯  To hot reload changes while running, press "r". To hot restart (and rebuild state), press "R".
[        ] An Observatory debugger and profiler on Tane's iPhone is available at: http://127.0.0.1:1025/
[        ] For a more detailed help message, press "h". To detach, press "d"; to quit, press "q".
flutter analyze results:
No issues found
flutter doctor -v
[βœ“] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14.2 18C54, locale en-US)
    β€’ Flutter version 1.0.0 at /users/michaelnelson/flutter
    β€’ Framework revision 5391447fae (7 weeks ago), 2018-11-29 19:41:26 -0800
    β€’ Engine revision 7375a0f414
    β€’ Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[βœ“] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    β€’ Android SDK at /Users/michaelnelson/Library/Android/sdk
    β€’ Android NDK location not configured (optional; useful for native profiling support)
    β€’ Platform android-28, build-tools 28.0.3
    β€’ Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    β€’ Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    β€’ All Android licenses accepted.

[βœ“] iOS toolchain - develop for iOS devices (Xcode 10.1)
    β€’ Xcode at /Applications/Xcode.app/Contents/Developer
    β€’ Xcode 10.1, Build version 10B61
    β€’ ios-deploy 1.9.4
    β€’ CocoaPods version 1.5.3

[βœ“] Android Studio (version 3.2)
    β€’ Android Studio at /Applications/Android Studio.app/Contents
    β€’ Flutter plugin version 31.3.1
    β€’ Dart plugin version 181.5656
    β€’ Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[βœ“] VS Code (version 1.30.2)
    β€’ VS Code at /Applications/Visual Studio Code.app/Contents
    β€’ Flutter extension version 2.21.1

[!] Connected device
    ! No devices available

Metadata

Metadata

Assignees

Labels

e: device-specificOnly manifests on certain devicesp: cameraThe camera pluginpackageflutter/packages repository. See also p: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions