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

Hi.

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

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'
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
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:'

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!

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 :slight_smile:

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.

1 Like

@Antony-Blackett Where do you see the Checkbox for Checking iOs File to include on iOs build?

@magonicolas You see it in the inspector when you select the script in the project view.

@pahe thanks, and you know which Fb file Should I do this to?

@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.

Have anyone figured out why this is happening? Why would an Editor plugin be built by xcode?

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.

Hi.
Can anyone help me to avoid this bug with commandline assembly from TeamCity?


I have no idea why this error appears but that fix works, error gone

3 Likes

@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.

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 :frowning:
Is there a way to link a lighter library ?
Thanks