BSMachError on granting access to camera

后端 未结 3 966
时光说笑
时光说笑 2021-01-24 16:58

This is a mystery to me and I hope you can help me out...

I have made an app that has got a QR-scanner and when accessing it on a fresh install on my iphone an alert is

相关标签:
3条回答
  • 2021-01-24 17:39

    It might be occurring due to missing permissions. Try adding the below in Info.plist keys like NSPhotoLibraryUsageDescription

    0 讨论(0)
  • 2021-01-24 17:40

    Xcode 8.2.1, iOS 10.2.1

    Just ran into the same issue. Please make sure you have a message entered for NSCameraUsageDescription and NSPhotoLibraryUsageDescription.

    To easily find these keys select "Show Raw Keys & Values" from the Editor menu.

    Hope this helps.

    Cheers.

    0 讨论(0)
  • 2021-01-24 17:41

    Found the problem!

    The issue suddenly occurred in my new project as well, so I started debugging! While running the app I checked out the Debug View Hierarchy (the 3D snapshot function in the console menu)...

    So it turned out that there was a second instance of the UI running on top of another one - This is the reason why my camera-view appeared to have frozen.

    Cause: I have a slide-out menu (from tutorial: http://dennissuratna.com/slide-out-navigation-swift/) set in my app and had added login and registration-views (from tutorial: https://www.youtube.com/watch?v=PKOswUE731c) to the project. Now I found out that the second instance of the UI was created after logging into the app and thereby causing the problem. Removing the connections to the login and reg-views solved the issue, so now I just have to find out where to make the proper implementations for it all to work as desired.

    NOTE: The BSMachError-message is still printed out in the console whenever I run a fresh install of the app on my iPhone. The "error" is printed in the console when the alert for granting access to the camera is shown on screen.
    The app runs as expected, without any problems, so I think it's safe to say that the
    BSMachError-printout should be viewed as a printout and not an actual error that would cause a potential crash.

    0 讨论(0)
提交回复
热议问题