iOS Project Builder Error - Face Tracking Sample

I am trying to test the Face Tracking 3D Model sample github project on iOS by building it on Windows with iOS Project Builder. However, I am getting the following error when building the XCode project with iOS Project Builder,

Libraries/com.zappar.uar/Plugins/iOS/zappar-unity.mm(18,27): error: invalid token at start of a preprocessor expression
#if !ZAPPAR_METAL_SUPPORT && (TARGET_OS_IOS || TARGET_OS_IPHONE)
^
Libraries/com.zappar.uar/Plugins/iOS/zappar-unity.mm(93,27): error: invalid token at start of a preprocessor expression
#if !ZAPPAR_METAL_SUPPORT && (TARGET_OS_IOS || TARGET_OS_IPHONE)
^
Libraries/com.zappar.uar/Plugins/iOS/zappar-unity.mm(104,26): error: expected value in expression
#if !ZAPPAR_METAL_SUPPORT
^
Libraries/com.zappar.uar/Plugins/iOS/zappar-unity.mm(163,25): error: expected value in expression
#if ZAPPAR_METAL_SUPPORT
^
Libraries/com.zappar.uar/Plugins/iOS/zappar-unity.mm(175,24): error: use of undeclared identifier ‘s_mVertexBuffers’
void* mapped = s_mVertexBuffers[fmb.first]; //malloc(bufferSize);
^
5 errors generated.

  • [arm64] Linking UnityFramework…
    ld: file not found: build/Release-iphoneos/UnityFramework/arm64/Libraries/com.zappar.uar/Plugins/iOS/zappar-unity.mm.obj

Can someone let me know what could be going wrong? I have the ZCV.bundle folder at the root of my iOS build.

The image tracking sample project worked fine using the iOS project builder and I was able to test out the sample on my iPhone by building it on Windows.

To give an update, the build worked fine when I replaced

#define ZAPPAR_METAL_SUPPORT

with

#define ZAPPAR_METAL_SUPPORT 1

in the zappar-unity.h file.

However, the face tracking is not working as expected and I believe it has got something to do with the ZCV.bundle file not getting pulled in to the final build. Is there any way to check whether this package is present in the final ipa file using a check from the Unity side?

Hello @yinandyangtiger

It seems the external plugin (iOS Project Builder) that you’re using is unable to process iOS native scripts *.mm which in normal Mac workflow will be compiled by XCode after you’ve build Unity project. I haven’t used the plugin myself, but guess it doesn’t support compiling of source file from Xcode Project on windows.
I would suggest contacting that plugin provider for support, who may have experienced this issue with other projects and can suggest any possible solution.

Best,