Search Unity

ARKit 2 issue with image anchors and PNG files

Discussion in 'AR' started by todds_unity, Oct 1, 2018.

  1. todds_unity

    todds_unity

    Joined:
    Aug 1, 2018
    Posts:
    324
    Hi ARKit Fans,

    We have discovered that there are some instances with ARKit 2 and image anchor functionality not working. Specifically, the ARSession will fail to be created with an error message similar to the following:

    This issue is on the ARKit side and is actively being worked on. Creating anchor reference images from PNG files seems to cause the issue.

    As a work-around, you may need to use JPG images as the source for creating reference images.

    Todd
     
  2. dnoparker

    dnoparker

    Joined:
    Aug 28, 2013
    Posts:
    63
    We found that every time we compiled the code we would need to manually change the physical size in XCode. This was our workaround for the issue.
     
  3. peter_unity233

    peter_unity233

    Joined:
    Oct 24, 2018
    Posts:
    7
    @dnoparker how did you 'manually change' the physical size in XCode? I'm setting the size of the png image in the xcassets against the image but it's not doing anything? I'm wondering if the png issue is related to transparency. I've gotten image detection working with jpgs but am interested to see if it works with transparency in the image (hence the png)…
     
  4. peter_unity233

    peter_unity233

    Joined:
    Oct 24, 2018
    Posts:
    7
    Just a follow-up, no transparency in the png didn't make a difference. Still not working for me.
     
  5. dnoparker

    dnoparker

    Joined:
    Aug 28, 2013
    Posts:
    63
    On the right-hand side of Xcode click on the little folder icon. Click on the folder 'Images.xcassets'

    From inside there, navigate to your image and select it. Once you've selected it, click on the icon cicrled here -
    https://curriculum-content.s3.amazonaws.com/ios-segues-and-nav-controllers-unit/xcode_size_menu.png

    You should then see settings for the size.