Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice

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

Discussion in '2018.3 Beta' started by aurelien-morel-ubiant, Oct 11, 2018.

  1. aurelien-morel-ubiant

    aurelien-morel-ubiant

    Joined:
    Sep 27, 2017
    Posts:
    275
    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
     
    LeonhardP likes this.
  2. SagoRich

    SagoRich

    Joined:
    Jul 21, 2014
    Posts:
    15
    I have encountered this too, with 2018.3.0b5.
     
  3. BSteenson

    BSteenson

    Joined:
    May 23, 2018
    Posts:
    3
    I sent a bug report to Unity about this a day or 2 ago, no response yet.
     
  4. Lukas_Andriejunas

    Lukas_Andriejunas

    Unity Technologies

    Joined:
    Aug 19, 2016
    Posts:
    20
  5. aurelien-morel-ubiant

    aurelien-morel-ubiant

    Joined:
    Sep 27, 2017
    Posts:
    275
  6. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,135
    The fix will be in b6.
     
    aurelien-morel-ubiant likes this.