Skip to main content

Troubleshooting

_OBJC_CLASS errors when trying to build xCode project

Error example

The reason for the error is the missing CoreML framework in platform settings. After xCode project this option may be turned off in some Unity version. Steps to fix the issue:

  1. Select BNBRecognizer plugin in Unity assets.
  2. Make sure the following frameworks are enabled:
  • Framework dependencies → AdSupport
  • Rarely used frameworks → Accelerate
  • Rarely used frameworks → CoreML

UnityGfxDeviceWorker (38): hit program assert error when running xCode project

Go to BanubaSdk* -> Edit scheme and uncheck Metal -> API Validation.

Image

* Your project's original name.

The app's Info.plist must contain an NSCameraUsageDescription key

*Error example*

To fix NSCameraUsageDescription exception, add this key to your app Info.plist.

Failed to load 'Assets/Plugins/Win/BNBRecognizer.dll' because one or more of its dependencies could not be loaded.

The reason for the error is the missing Visual Studio 2019 Redistributables package in the OS. To fix this error, download and install vc_redist package for your Windows (x64 or x86) from the Microsoft website

BNBRecognizer.a(recognizer.cpp.o) does not contain bitcode.

To fix this issue open Unity-iPhone target → Build Settings, find and disable Enable Bitcode setting. Image

Not found architecture for BNBRecognizer.a build

The reason of this issue is the attempt to build the app with incorrect architecture (i.e. armv7). BNBRecognizer.a requires only arm64 architecture. Make sure that it was set up here: Image

Errors DllNotFoundExeption and NullReferenceExeption on Windows

Image

To fix these errors you should install the following tools on Microsoft VS 2019: Image

Unity-iPhone has conflict provisioning settings

Image

  1. Open Build Settings tab

  2. Find Signing section and multiple values: ReleaseForRunning, Any iOS SDK Image

  3. Change the parameters to iOS Developer Image

Color space issues

Some of the effects that contain morphing, lut or beautification provided with BanubaSDK assume gamma color space: Image

If your project depends on linear color space(for example HDRP) you need to fix some shaders or import new textures for linear space

Example for morphing feature how to fix shader:

  1. find Assets/BanubaFaceAR/FeatureMorphing/Shaders/Morphing.shader
  2. find the line with _StaticPosTex calculations:
float3 st_tex = tex2Dlod(_StaticPosTex, float4(1. - o.uv.x, 1. - o.uv.y, 0, 0)).xyz;
  1. transform st_tex to gamma space using:
st_tex = pow(st_tex, 0.454545)