Search Unity

iOS Build is not compiling anymore after update to Unity 5 (Facebook SDK problem?)

Discussion in 'iOS and tvOS' started by pahe, Mar 5, 2015.

  1. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    424
    Hi.

    I've updated my project yesterday to 5.0 and now I get a strange error when trying to compile the xCode project:

    Code (csharp):
    1.  
    2. 399: [xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150305-19419-17zlblh/Project/Unity_Client/Assets/Facebook/Editor/iOS/FbUnityInterface.mm:561:73: error: ARC forbids explicit message send of 'autorelease'
    3. 400: [xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150305-19419-17zlblh/Project/Unity_Client/Assets/Facebook/Editor/iOS/FbUnityInterface.mm:561:73: error: 'autorelease' is unavailable: not available in automatic reference counting mode
    4. 401: [xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150305-19419-17zlblh/Project/Unity_Client/Assets/Facebook/Editor/iOS/FbUnityInterface.mm:662:15: error: no known class method for selector 'publishInstall:withHandler:'
    5.  
    I'm not a big pro in objective C, so the error message just tells me, that something in the Facebook plugin seems not to be compatible. I updated the plugin already to the latest version, no luck though. Still the same error.
    Does anyone has a tip what I have to do to make it compile again?

    Thx 4 help!
     
  2. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    424
    Ok, I found how to solve this problem here. Now the problem is, that I have to set it up in the xCode project, as the file is not under "Plugins/iOS", but under "Editor/Facebook/iOS" and there I can't set the custom compiler flags.

    Well, I think I move the files simply over and hope that this solves the problem :)
     
  3. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,348
    I've got the same issue. I solved it by doing what you said, you don't need to move the file either, just select it and then check the iOS checkbox to include this file in your iOS build. I thought it might double up that file in the xCode project but it doesn't seem to.
     
    fschneider likes this.
  4. magonicolas

    magonicolas

    Joined:
    Dec 4, 2013
    Posts:
    30
    @Antony Blackett Where do you see the Checkbox for Checking iOs File to include on iOs build?
     
  5. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    424
    @magonicolas You see it in the inspector when you select the script in the project view.
     
  6. magonicolas

    magonicolas

    Joined:
    Dec 4, 2013
    Posts:
    30
    @pahe thanks, and you know which Fb file Should I do this to?
     
  7. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    424
    @magonicolas In my case it was the FbUnityInterface.mm file, but I can't guarantee that this will be the case for you too. You should look into the error message of your xCode project to see where the problem may be in your case.
     
  8. denlee0710

    denlee0710

    Joined:
    Mar 9, 2015
    Posts:
    29
    Have anyone figured out why this is happening? Why would an Editor plugin be built by xcode?
     
  9. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,348
    It's not an editor plugin. Facebook would have had a build script to move it in previous versions of Unity that no longer works in Unity 5 would be my guess. But now Unity has a system to do it itself. Facebook don't officially support Unity5 so they haven't set it up properly.
     
  10. Dukobpa3

    Dukobpa3

    Joined:
    May 21, 2015
    Posts:
    3
    Hi.
    Can anyone help me to avoid this bug with commandline assembly from TeamCity?
     
  11. Lev-Lukomskyi

    Lev-Lukomskyi

    Joined:
    Aug 26, 2013
    Posts:
    3

    I have no idea why this error appears but that fix works, error gone
     
    Last edited: Aug 7, 2015
    mirlanirokez, doodoori2 and frtlkmn like this.
  12. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    424
    @Lev Lukomskyi
    Afaik the xCode project needs to know if the plugin was written with ARC (Automatic Reference Counting, some kind of automated garbage collector for objC) or not. In this case the Facebook Plugin seems not be written with ARC, so you need to tell the Editor to set later the flag for no arc for that plugin. You can do it manually in the xCode project later of course, but this is the convinient way of Unity.

    There is not much documentation about that (at least I haven't found much when I had to deal with the problem), so take what I write with care. Maybe some objC pros can tell more or confirm.
     
  13. schouffy

    schouffy

    Joined:
    Mar 8, 2015
    Posts:
    3
    Hi,
    i had these issues and followed this thread to fix it. Works great, thanks.
    However, i have another question that's related. The FacebookSDK.a linked library is expanding hugely my app size (like, it was 30MB and now it's 100+MB). Seems really enormous for just using scores API :(
    Is there a way to link a lighter library ?
    Thanks
     
unityunity