Cloud Build still fails build with facebook SDK when build on 5.6

Description of issue:
Cloud Build Fails to build for android after adding Facebook SDK 7.9.4

The error says that the bundle id isn’t set properly but it is set in the project settings and it does build on the cloud without the Facebook SDK in the project.

Unity version: 5.6.0f3

XCode version: No idea what’s on the Cloud Build Servers assuming 8.x

Source control: Git

Local build platform: Windows 10, Unity 5.6.0f3, VS 2017 CE

Build target: Android (Non debug build)

Relevant plugins being used - Facebook SDK 7.9.4
Project name: FacebookSDK_Test

Build log (relevant chunk):

*** Completed ‘Build.Player.AndroidPlayer’ in 155 seconds (155258 ms)
2611: [Unity] Player export failed. Reason: The default Unity Bundle Identifier (com.Company.ProductName) will not work correctly.
2612: [Unity] UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
2613: [Unity] UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[ ])
2614: [Unity] UnityEngine.Logger:Log(LogType, Object)
2615: [Unity] UnityEngine.Debug:Log(Object)
2616: [Unity] UnityEditor.CloudBuild.BuildLogger:Log(String, Object[ ])
2617: [Unity] UnityEditor.CloudBuild.Builder:Build()
2618: [Unity] Refresh: detecting if any assets need to be imported or removed … Refresh: elapses 0.015749 seconds (Nothing changed)
2619: [Unity] Updating ProjectSettings/ProjectSettings.asset - GUID: 00000000000000004000000000000000…
2620: [Unity] done. [Time: 3.084436 ms]
2621: [Unity] Refreshing native plugins compatible for Editor in 9.51 ms, found 2 plugins.
2622: [Unity] Preloading 1 native plugins for Editor in 1.09 ms.
2623: [Unity] ----- Total AssetImport time: 0.090573s, AssetImport time: 0.031335s, Asset hashing: 0.000000s [0 B, 0.000000 mb/s]
2624: [Unity] Refresh: detecting if any assets need to be imported or removed … Refresh: elapses 0.014396 seconds (Nothing changed)
2625: [Unity] Cleanup mono
2626: [Unity] Checking for leaked weakptr:
2627: [Unity] Found no leaked weakptrs.
2628: [Unity] Assertion failed on expression: ‘ms_Instance != NULL’
2629: [Unity] ##unity-automation:{“messageType”:“MemoryLeaks”,“allocatedMemory”:166723,“memoryLabels”:[{“Default”:96},{“Permanent”:16128},{“Thread”:616},{“Manager”:1976},{“GfxDevice”:19072},{“GfxThread”:2688},{“Physics”:8},{“Serialization”:12704},{“JobScheduler”:144},{“GarbageCollector”:1048576},{“Renderer”:224},{“Terrain”:224},{“STL”:66048},{“String”:19354},{“DynamicArray”:3112},{“Utility”:-1048576},{“PoolAlloc”:-224},{“ScriptManager”:3280},{“Sprites”:1176},{“VR”:11404},{“EditorUtility”:544},{“AssetImporter”:368},{“RestService”:64},{“License”:965},{“UnityConnect”:6024},{“Collab”:728}]}
2630: ! Unity player export failed!
2631: ! build of ‘default-android’ failed. compile failed
2632: Publishing build 1 of randhall/client for target ‘default-android’…
2633: publishing finished successfully.
2634: done.
2635: Build step ‘Execute shell’ marked build as failure
2636: postbuildstatus finished successfully.
2637: Finished: FAILURE

Hello,

I was unable to reproduce this issue. Could you elaborate on what you mean by “it does build on the cloud without the Facebook SDK in the project”? Because I can only see one build on your project (not counting the build I just started)

  • Sophia

Sorry the project is a test project i created to highlight that the build doesn’t work, so it didn’t have a successful compilation in the history.
What i mean by it works without the Facebook SDK is that if you remove the FacebookSDK from the projects assets folder (Along with the generated manifest in the plugins/android folder) the build will work fine without any project settings changes)
The test project is a clean project without any content other than a start scene with some text on it and projects settings with the bundle id set to not be the default (which is a requirement for android builds).
The project is setup on github on a public repository:

https://github.com/Randhall/UnityFacebook_CloudBuildFailing

So feel free to fork it and see the structure.
In order to get it to build successfully you can just remove the FacebookSDK and Plugins folders and the build will work.
After pushing those changes CloudBuild will successfully build it.

I created two extra commits in the repository one in which i removed the facebook SDK (this push triggered build #3 which succeeded) I then reverted that change and pushed again and the build failed again (this push triggered build #4)
Hope that helps with your investigation.
Please let me know if i can help in any other way.

1 Like

We’re also experiencing Facebook related build failures since switching our cloud builds from 5.5.0 to 5.6.0. Manual builds compile just fine.

239: [Unity] Assets/FacebookSDK/SDK/Editor/FacebookPostprocess.cs(24,20): error CS0234: The type or namespace name `Unity' does not exist in the namespace `UnityEditor.Facebook'. Are you missing an assembly reference?
240: [Unity] Assets/FacebookSDK/SDK/Editor/android/ManifestMod.cs(27,20): error CS0234: The type or namespace name `Unity' does not exist in the namespace `UnityEditor.Facebook'. Are you missing an assembly reference?
241: [Unity] Assets/FacebookSDK/SDK/Editor/iOS/PListParser.cs(28,20): error CS0234: The type or namespace name `Unity' does not exist in the namespace `UnityEditor.Facebook'. Are you missing an assembly reference?
242: [Unity] Assets/FacebookSDK/SDK/Editor/FacebookPostprocess.cs(24,20): error CS0234: The type or namespace name `Unity' does not exist in the namespace `UnityEditor.Facebook'. Are you missing an assembly reference?
243: [Unity] Assets/FacebookSDK/SDK/Editor/android/ManifestMod.cs(27,20): error CS0234: The type or namespace name `Unity' does not exist in the namespace `UnityEditor.Facebook'. Are you missing an assembly reference?
244: [Unity] Assets/FacebookSDK/SDK/Editor/iOS/PListParser.cs(28,20): error CS0234: The type or namespace name `Unity' does not exist in the namespace `UnityEditor.Facebook'. Are you missing an assembly reference?

Same issue here with the Facebook errors after switching from 5.4.2 to 5.6.0, and it also compiles fine when I do it manually in Xcode 7.2.1.

Did you manage to find a solution?

Unity must have changed something related to the way scripts are being compiled, but I got it working.

I changed the Facebook plugin script’s namespace where it originally was “namespace UnityEditor.FacebookEditor” (which is a weird namespace for Facebook to put its code anyway) to “namespace Whatever.FacebookEditor”.

1 Like

This issue is still occuring for us, getting the same error as Randhall, any one able to successfully resolve this?

We are having this issue as well, even we do not use Facebook SDK in Unity, we are using Firebase, AdMob, Game Analytics.
Note that we can build iOS on cloud normally with Unity 5.4 with all these third party libraries above.

We’re waiting on a release of something pending this, is there any more information I/we can provide to assist?

Looks this was an introduced with 5.6

We are looking into it!

1 Like

I did this for all instances of “namespace UnityEditor.FacebookEditor” and then commented out any calls to ManifestMod as a temporary fix and then the cloudbuild started working for me again.

Prior to that I noticed that there is a bug in the Facebook Menu in Unity, the GUI throws me errors in my debug log and I don’t see most the fields that should populate it.

Where did you find those namespaces ? Facebook Unity SDK editor namespaces are Facebook.Unity.Editor.
Are those the namespaces in the facebook sdk that’s bundled with unity when you install Facebook GameRoom support ?

They are in the Facebook SDK, under the Editor Folder. Most of the namespaces are Facebook.Unity.Editor but some of the files (i.e. FacebookPostprocess.cs) has the UnityEditor.FacebookEditor namespace

Any new about this issue?

What is the status?

This error is no longer occurring on my Android 5.6 test project (I use “Latest 5.6” when building with Cloud Build)

Ok, I will try.

I still having problem with the build:

“An assembly with the same name `Facebook.Unity.Settings’ has already been imported.”

@GravyGaming PM me a link to your project