[BUG][CASE 1089831]XCode can't compile - CameraCapture.mm has a missing line

Hello guys,
It’s impossible since Unity 2018.3.0b4 and b5 (I don’t test previous build but I think it must happen too) to compile a XCode project generate with Unity if you use the Camera from your device.

It’s due to CameraCapture.mm.

If you have a project with a call to the Camera module and then if you generate your project in XCode.
It won’t compile.

The CameraCapture.mm that comes from Unity 2017 works fine.
Cause those lines are correct :
#define countof(arr) sizeof(arr)/sizeof(arr[0])
static_assert(countof(presetW) == countof(preset), “preset and preset width arrrays have different elem count”);

But in Unity 2018.3.0bX, those lines (and most of the lines) from this file changed and are now this one :
const int count = STATIC_ARRAY_COUNT(preset);

so the STATIC_ARRAY_COUNT(preset) isn’t defined.

A line is missing and it’s :
#define STATIC_ARRAY_COUNT(arr) sizeof(arr)/sizeof(arr[0])

with this one, you can compile.

Cheers.
Aurélien.

P.S : I create a ticket, I’ll update the title from this post as soon as I have the case number

1 Like

I have encountered this too, with 2018.3.0b5.

I sent a bug report to Unity about this a day or 2 ago, no response yet.

Hi,

Thank you for reporting the problem.

The issue is known and we are already rolling the fix soon to the upcoming unity beta release.
You can track the original issue status here: Unity Issue Tracker - [iOS] [BLOCKING] CameraCapture.mm script causing STATIC_ARRAY_COUNT error, preventing testing with Vuforia

Regards,
Lukas A.
Unity QA Team

2 Likes

Ok thanks !

The fix will be in b6.

1 Like