Search Issue Tracker

Fixed in 2020.2

Fixed in 2018.4, 2019.4

Votes

1

Found in

2018.4

2018.4.16f1

2019.2

2019.4

Issue ID

1217018

Regression

Yes

Calling WebCamTexture.Play() causes an NSInternalInconsistencyException and crashes the application if camera access is denied

iOS

-

How to reproduce:
1. Open the project "1217018.zip"
2. Build for iOS
3. Deploy the project on an iOS device

Expected result: the project launches successfully
Actual result: an NSInternalInconsistencyException is thrown in Xcode's console

Reproducible with: 2018.4.24f1 (see note 1), 2019.2.21f1 (see note 1), 2019.4.3f1 (see note 1),
Not reproducible with: 2018.4.23f1 (see note 2)
Could not test with: 2019.1.14f1 (see note 3), 2019.3.0a1 (see note 3), 2020.1.0b14 (see note 4), 2020.2.0a1 (see note 4), 2020.2.0a17 (due to a "Failed running bee.exe" error in the Unity console)

Reproduces on: VLNQA00160 iPhone 6S iOS 13.3.1

Notes:
1. The error in the Xcode console (full error in an edit):
WebCamDevices[1617:1755538] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cannot pick capture preset'
2. The application does not run into an exception upon trying to run the application; instead, the application launches, requests camera access, and once camera access is denied and the app is fully closed, launching the app once more causes it to crash.
3. An NSInvalidArgumentException is thrown:
WebCamDevices[1684:1767797] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[AVCaptureSession addInput:] Can't add a nil AVCaptureInput'
4. No cameras can be found (WebCamTexture.devices.Length returns 0)

  1. Response avatar

    Resolution Note (fix version 2020.2):

    This was fixed by changeset 9fffce07ca78 for case 1187431 and landed in 2020.1.0a11

Comments (3)

  1. 5505f9574572edd1103f430cad8631fe?d=mm

    Fillmore

    Jul 03, 2020 14:36

    Lastly, is it possible to include a method for checking if we have camera access?

    bool WebcamTexture.HasCameraAccess();

  2. 5505f9574572edd1103f430cad8631fe?d=mm

    Fillmore

    Jul 03, 2020 14:31

    After fixing, it would be great to change WEBCAMTEXTURE.PLAY()

    It could return a bool,
    true = it was able to be played. (Access granted)
    false = it was not able to be played. (Access denied)

  3. 5505f9574572edd1103f430cad8631fe?d=mm

    Fillmore

    Jul 03, 2020 14:26

    Upon first launch, you will get a prompt to Accept/Deny the camera.
    - Deny it
    Fully close the app, ending it from the task manager.
    Open the app again, and you will see the freeze or crash.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.