Heads up! We're sunsetting this forum to streamline our community space.

join us on Discord for support, updates, and all things Snap AR! See you there!
Sign up for our live Camera Kit office hour on July 17 @ 9:30am (PT) / 4:30pm (GMT)

Requesting assistance for LSAGLView error in Camera Kit IOS app?

AliveNow Creative Tech
AliveNow Creative Tech Posts: 20 πŸ”₯
edited January 2023 in General #1

Hi All, We are working on a Camera Kit SDK IOS sample. We are able to run the GitHub repository IOS sample successfully. We are now integrating the Camera Kit into a new app and we are facing the following errors:

Backtrace:

[error] Error, [LSAGLView::drawTexture] LS::Exception : [LSAGLView] attempt to use deleted framebuffer

Can anyone please help me out with this error?

Thank you.

Answers

  • stevenxu
    stevenxu Posts: 612 πŸ‘»
    edited January 2023 #2

    @AliveNow Creative Tech Thanks for posting here. Submitted a ticket for our iOS eng team to look into this for you.

    In the meantime, what SDK version are you using and what device model are you testing it on (if it applies)?

    Steven

  • arashp
    arashp Posts: 52 πŸ”₯πŸ”₯

    Hi @AliveNow Creative Tech, thank you for reporting the issue. I don't think we have seen this before. We can't reproduce it on our side at the moment and without that we are unable offer a solution.

    Along with the details that @stevenxu mentioned, would you be able to send us a small project or steps to reproduce the issue? If it's a small project, it can be uploaded through our support form.

  • AliveNow Creative Tech
    AliveNow Creative Tech Posts: 20 πŸ”₯
    edited January 2023 #4

    Hi @stevenxu and @arashp, Thank you so much for the response.

    I am using the Camera Kit SDK version 1.18.1 and tested the app on iPhone 13.

    @arashp, Below are the steps that I am following to integrate Camera Kit into a new app.

    1. Added and installed all the pods mentioned in this link (https://docs.snap.com/snap-kit/camera-kit/guides/quick-start/integrate-sdk/integrate-sdk-app/ios#adding-the-sdk)
    2. Copied all the AppDelegate functions from the GitHub repository IOS sample and added them into a new project AppDelegte.

    When I build and run the app into a device it was asking the camera and microphone permissions after that it gives me a black screen.

    In the console it shows the below error, please check:

    Backtrace:
    [error] Error, [LSAGLView::drawTexture] LS::Exception : [LSAGLView] attempt to use deleted framebuffer

    Can you please help me out with this?

    Thank you.

  • arashp
    arashp Posts: 52 πŸ”₯πŸ”₯

    Hi @AliveNow Creative Tech, thanks very much for those repro steps. There are basically two pieces for a very basic integration: the functions in the AppDelegate and values in info.plist.

    Have you copied over the info.plist from the sample app in its entirety? Some setting there might be preventing your camera from starting, in which case Camera Kit does not have any frames to process, resulting in the error you see.

    If you have both pieces and the app is building and running, then the integration should work. Please let us know if that is still not the case.

  • AliveNow Creative Tech
    AliveNow Creative Tech Posts: 20 πŸ”₯
    edited January 2023 #6

    Hi @arashp, Thank you so much for your response. I was able to integrate the Camera Kit into a new IOS app based on your suggestions but I am not able to see the top-right icons.

    Please check the screenshot that I have attached:

    Is there any setting that I am missing? Can you please help me out with this?

    Thank you.

  • arashp
    arashp Posts: 52 πŸ”₯πŸ”₯

    Hi @AliveNow Creative Tech, That's great that you were able to integrate the SDK. But it is strange that you were still missing those icons. That element is CameraActionsView. It should be displayed automatically by ReferenceUI.

    Could you put a breakpoint in CameraActionsView.getter:flipCameraButton and see if you ever hit it?

  • AliveNow Creative Tech
    AliveNow Creative Tech Posts: 20 πŸ”₯
    edited January 2023 #8

    Hi @arashp, The breakpoint hits when I put at flipCameraButton. I have tried adding a .png extension to an image name but still, the icons are missing.

    I am attaching the breakpoint screenshot, please check:

    The button actions are working fine only icons are missing.

    Can you please help me out with this?

    Thank you.

  • AliveNow Creative Tech
    AliveNow Creative Tech Posts: 20 πŸ”₯
    edited January 2023 #9

    @arashp, Also one more help from your side

    How can I close the Camera Kit View when I click the button so that it can redirect to the ViewController? (i.e Main Storyboard)

    I have tried changing the rootViewController from cameraViewController to a ViewController and tried to stop AVCaptureSession but still, the Camera Kit view has not stopped.

    My scenario is when I click the button from ViewController it has to load the Camera Kit view and when I click the back button from Camera Kit view it has to go to ViewController.

    Can you please help me out with this?

    Thank you.

  • arashp
    arashp Posts: 52 πŸ”₯πŸ”₯

    Thank you and sorry for the delay @AliveNow Creative Tech. That's great that flipCameraButton() is getting called. What happens when you "step over" the code in Xcode and reach line 15 button.setImage()? Does the button have an image on it?

    If the button doesn't have an image, it means either your project doesn't have the ck_camera_flip image or the link to it is incorrect on line 16.

  • arashp
    arashp Posts: 52 πŸ”₯πŸ”₯

    Thanks for starting a new thread on the CameraView question. I posted a reply there.

  • arashp
    arashp Posts: 52 πŸ”₯πŸ”₯

    A quick note on the original error:
    [error] Error, [LSAGLView::drawTexture] LS::Exception : [LSAGLView] attempt to use deleted framebuffer

    As mentioned this was due to a difference in info.plist. Investigating this further, removing the key Scene Configuration from info.plist should resolve the issue. This key is added to any fresh app project in iOS but it is absent from the iOS sample app.

  • arashp
    arashp Posts: 52 πŸ”₯πŸ”₯

    To avoid this confusion in the future, the team is investigating a fix with migrating the CameraKit setup from the AppDelegate to the SceneDelegate.

Categories