Search Unity

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

Discussion in 'Unity Build Automation' started by Randhall, Apr 20, 2017.

  1. Randhall

    Randhall

    Joined:
    Feb 21, 2013
    Posts:
    17
    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
     
  2. SophiaC

    SophiaC

    Joined:
    Sep 6, 2016
    Posts:
    238
    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
     
  3. Randhall

    Randhall

    Joined:
    Feb 21, 2013
    Posts:
    17
    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.
     
  4. Randhall

    Randhall

    Joined:
    Feb 21, 2013
    Posts:
    17
    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.
     
    masterton likes this.
  5. esg-joshmorhart

    esg-joshmorhart

    Joined:
    Oct 10, 2016
    Posts:
    9
    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.

    Code (CSharp):
    1. 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?
    2. 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?
    3. 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?
    4. 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?
    5. 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?
    6. 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?
     
  6. FaetterJens

    FaetterJens

    Joined:
    Aug 18, 2015
    Posts:
    10
    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?
     
  7. FaetterJens

    FaetterJens

    Joined:
    Aug 18, 2015
    Posts:
    10
    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".
     
    re-cheid likes this.
  8. Treadon

    Treadon

    Joined:
    Aug 22, 2014
    Posts:
    4
    This issue is still occuring for us, getting the same error as Randhall, any one able to successfully resolve this?
     
  9. phucvin

    phucvin

    Joined:
    Nov 12, 2015
    Posts:
    5
    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.
     
  10. Treadon

    Treadon

    Joined:
    Aug 22, 2014
    Posts:
    4
    We're waiting on a release of something pending this, is there any more information I/we can provide to assist?
     
  11. SophiaC

    SophiaC

    Joined:
    Sep 6, 2016
    Posts:
    238
    Looks this was an introduced with 5.6

    We are looking into it!
     
    ipodster likes this.
  12. xofreshxo

    xofreshxo

    Joined:
    Apr 12, 2017
    Posts:
    79
    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.
     
  13. Randhall

    Randhall

    Joined:
    Feb 21, 2013
    Posts:
    17
    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 ?
     
  14. xofreshxo

    xofreshxo

    Joined:
    Apr 12, 2017
    Posts:
    79
    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
     
  15. ipodster

    ipodster

    Joined:
    Mar 7, 2014
    Posts:
    11
    Any new about this issue?
     
  16. GravyGaming

    GravyGaming

    Joined:
    Nov 25, 2015
    Posts:
    8
    What is the status?
     
  17. SophiaC

    SophiaC

    Joined:
    Sep 6, 2016
    Posts:
    238
    This error is no longer occurring on my Android 5.6 test project (I use "Latest 5.6" when building with Cloud Build)
     
  18. GravyGaming

    GravyGaming

    Joined:
    Nov 25, 2015
    Posts:
    8
    Ok, I will try.
     
  19. GravyGaming

    GravyGaming

    Joined:
    Nov 25, 2015
    Posts:
    8
    I still having problem with the build:

    "An assembly with the same name `Facebook.Unity.Settings' has already been imported."
     
  20. SophiaC

    SophiaC

    Joined:
    Sep 6, 2016
    Posts:
    238
  21. ParkyRander

    ParkyRander

    Joined:
    Jun 1, 2014
    Posts:
    8
    Anyone had any success getting Unity Cloud build to work with Facebook SDK (7.9.4) & Unity 5.6 for Android ?

    I managed to get rid of the duplicate Facebook Settings library file issue by manually modify my ProjectSettings.asset file as follows :
    facebookSdkVersion: plugin

    But I still can't get my project to build. My project is literally just the Facebook SDK and nothing else.

    Unity Cloud build compact log reads as follows :


    1: [Unity] Initialize engine version: 5.6.1f1 (2860b30f0b54)
    2: [Unity] System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
    3: [Unity] System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
    4: [Unity] Initialize engine version: 5.6.1f1 (2860b30f0b54)
    5: [Unity] WARNING: Shader Unsupported: 'VR/SpatialMapping/Wireframe' - Pass '' has no vertex shader
    6: [Unity] WARNING: Shader Unsupported: 'VR/SpatialMapping/Wireframe' - Setting to default shader.
    7: [Unity] Player export failed. Reason: The default Unity Bundle Identifier (com.Company.ProductName) will not work correctly.
    8: ! build of 'default-android' failed. compile failed
    9: publishing finished successfully.
    10: Finished: FAILURE

    Burnt over a week on this. My Bundle identifier is definitely set up ok in my project.
     
  22. Cliwo

    Cliwo

    Joined:
    Oct 12, 2016
    Posts:
    12
    I'm still getting this bug

    1: [Unity] Initialize engine version: 5.6.2f1 (a2913c821e27)
    2: [Unity] -----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/Assembly-CSharp-Editor.dll
    3: [Unity] Compilation failed: 3 error(s), 0 warnings
    4: [Unity] Assets/Code/3rdParty/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?
    5: [Unity] Assets/Code/3rdParty/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?
    6: [Unity] Assets/Code/3rdParty/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?
    7: [Unity] Assets/Code/3rdParty/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?
    8: [Unity] Assets/Code/3rdParty/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?
    9: [Unity] Assets/Code/3rdParty/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?
    10: [Unity] System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
    11: [Unity] System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
    12: [Unity] -----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/Assembly-CSharp-Editor.dll
    13: [Unity] Compilation failed: 3 error(s), 0 warnings

    exactly same with above ones.

    I tried to build on iOS and Unity version is 5.6.2f1(as you can see on above)
     
  23. JustGeoff

    JustGeoff

    Joined:
    Feb 2, 2017
    Posts:
    1
    What about your Stand-alone "Bundle Identifier"? - can you update that one as well..? I noticed that when I changed this along with my other " AndroiTarget" - then it would build fine on UCB

    The "bug" is coming from here: https://github.com/facebook/faceboo.../Facebook.Unity.Editor/FacebookPostprocess.cs
     
  24. GravyGaming

    GravyGaming

    Joined:
    Nov 25, 2015
    Posts:
    8
    The problem still happening with Unity Cloud Build and Facebook Sdk, is there anyone from Unity team to solve this problem????
     
  25. IonRift

    IonRift

    Joined:
    Jan 14, 2013
    Posts:
    16
    Also having this issue on iOS Builds

    "An assembly with the same name `Facebook.Unity.Settings' has already been imported."
     
  26. djmarcin

    djmarcin

    Joined:
    Oct 17, 2014
    Posts:
    2
    #23 solves the following error, but I didn't get what it was saying to do at first:
    Player export failed. Reason: The default Unity Bundle Identifier (com.Company.ProductName) will not work correctly.
    8: ! build of 'default-android' failed. compile failed

    JustGeoff says to update the stand alone Bundle Identifier. What that means is go into the PC, Mac & Linux Standalone platform Player Settings and set the Bundle Identifier there, not just in Android. For some reason the facebook-unity-sdk is pulling the wrong bundle identifier during post-processing. I filed an issue on their GitHub repo. (https://github.com/facebook/facebook-sdk-for-unity/issues/96)
     
  27. re-cheid

    re-cheid

    Joined:
    Apr 10, 2017
    Posts:
    34
    That did the trick for me, thanks!