Search Unity

`Facebook.Unity.Settings' has already been imported error

Discussion in 'Unity Build Automation' started by Bruder, Apr 25, 2017.

  1. Bruder

    Bruder

    Joined:
    Aug 9, 2014
    Posts:
    56
    Hi All,
    I started getting this error on my Android cloud build recently. (working with Unity 5.6)
    Nothing have been changed in the Facebook sdk, can anyone please give me a hint about how to solve it?

    Here is the colud build log:
    990: [Unity] -----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/Assembly-CSharp-firstpass.dll
    991: [Unity] Compilation failed: 1 error(s), 0 warnings
    992: [Unity] error CS1704: An assembly with the same name `Facebook.Unity.Settings' has already been imported. Consider removing one of the references or sign the assembly
    993: [Unity] Library/FacebookSDK/Facebook.Unity.Settings.dll (Location of the symbol related to previous error)
    994: [Unity] Assets/FacebookSDK/Plugins/Settings/Facebook.Unity.Settings.dll (Location of the symbol related to previous error)
    995: [Unity] - Finished compile Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll
    996: [Unity] error CS1704: An assembly with the same name `Facebook.Unity.Settings' has already been imported. Consider removing one of the references or sign the assembly
    997: [Unity] Library/FacebookSDK/Facebook.Unity.Settings.dll (Location of the symbol related to previous error)
    998: [Unity] Assets/FacebookSDK/Plugins/Settings/Facebook.Unity.Settings.dll (Location of the symbol related to previous error)
    999: [Unity] Compilation failed: 1 error(s), 0 warnings
     
    mog-mog-mog and Poemind like this.
  2. Poemind

    Poemind

    Joined:
    May 25, 2011
    Posts:
    30
    I'm having this issue right now. I'd love some info on this. I'm going to look.
     
    Bruder likes this.
  3. Mouldi

    Mouldi

    Joined:
    Feb 23, 2013
    Posts:
    20
    I'm having the same issue still don't understand why you made it native #unityGuys !!
     
    Last edited: Apr 26, 2017
    Bruder likes this.
  4. esg-joshmorhart

    esg-joshmorhart

    Joined:
    Oct 10, 2016
    Posts:
    9
    We're also experiencing this error on Unity 5.6. From what we can tell it's because Unity 5.6 introduced the Facebook Game Room build target. If you have that module installed on your build machine it will cause a collision with your existing Facebook SDK, even if you are not targeting the Game Room platform. However, you also can't compile your game if you remove your duplicate Facebook SDK. It seems like the Facebook.Unity namespace is available to all targets if the Game Room module is installed.
     
    devotionsolutions likes this.
  5. devotionsolutions

    devotionsolutions

    Joined:
    Feb 9, 2013
    Posts:
    40
    Same here. This is really annoying. Is there any workaround for this? Do I need to reinstall Unity without game room?!
     
    yunknuy likes this.
  6. devotionsolutions

    devotionsolutions

    Joined:
    Feb 9, 2013
    Posts:
    40
    I've found a workaround..
    1. Close Unity Editor
    2. Remove the Facebook folder in C:\Program Files\Unity\Editor\Data\PlaybackEngines
    3. Remove the FacebookSDK folder in your project's Library folder
    4. Import FacebookSDK
    5. Profit?
     
  7. Mouldi

    Mouldi

    Joined:
    Feb 23, 2013
    Posts:
    20
    Thanks # blumersolutions, and what about the cloud building is there any solution ?
    has anyone tried the cloud build with 5.6.0p1 or 5.6.0p2 ?
     
    dccoo likes this.
  8. ESG_Brad

    ESG_Brad

    Joined:
    May 15, 2015
    Posts:
    3
    Cloud build started working for us after we updated our Facebook SDK to 7.9.4. I'm not sure if they fixed something on their end while we were testing since one build failed and then all subsequent builds were fine.
     
  9. Mouldi

    Mouldi

    Joined:
    Feb 23, 2013
    Posts:
    20
    #ESG_Brad, Thanks for the insight .
    what unity version, and cloud unity version you're using ? #ESG_Brad
    and did you change any specific config for the facebook SDK ?
     
  10. ESG_Brad

    ESG_Brad

    Joined:
    May 15, 2015
    Posts:
    3
    Unity version is 5.6.0f3. using the same version to build on cloud build. To update the Facebook SDK I just removed the old FacebookSDK folder, imported the new package, and reapplied our settings.
     
  11. Mouldi

    Mouldi

    Joined:
    Feb 23, 2013
    Posts:
    20
    @ESG_Brad Thanks man, i'll try that, though i've already moved to 5.6.0p2 .
     
    pdafedar likes this.
  12. Trisibo

    Trisibo

    Joined:
    Nov 1, 2010
    Posts:
    245
    Not for me, I just imported FB 7.9.4 fresh and then created a new Cloud Build project, and I get the error... Is there anything else you did?
     
  13. ESG_Brad

    ESG_Brad

    Joined:
    May 15, 2015
    Posts:
    3
    Can you paste in the errors just to make sure we're on the same page?
     
  14. Trisibo

    Trisibo

    Joined:
    Nov 1, 2010
    Posts:
    245
    Yep:

     
  15. Mouldi

    Mouldi

    Joined:
    Feb 23, 2013
    Posts:
    20
    alright guys here is some updates, after the long battle with the cloud build system,
    i have made some changes as follow:
    * first i updated to FB 7.9.4 as @ESG_Brad said and that worked very well no more already imported error when building for ios.
    * Secondly i rolled back to Unityv 5.6.03 and luckelly for me nothing broke i guess they used the same serialization system between 5.6.03 and 5.6.03p1 or 2
    * Lastly i removed all unresolved errors like undefined objects and hundled most of my exceptions, and removed all extra assets in my project and i've found that some of the build errors where happening due to some # *.dds Textures# and i've learnd that, when i tried to build locally and checked the Console on XCode.

    Moral of the story 5.6.3 works on cloud and locally you have just to clean your project(specially the *.dds files they cause lot of truble when creating materials in ios), handle all exceptions and update your plugins .

    Thanks everybody for your help .
     
  16. Treadon

    Treadon

    Joined:
    Aug 22, 2014
    Posts:
    4
    We are still unable to successfully build, we've upgraded Facebook SDK 7.9.4 and are using 5.6 Latest to build. Builds work on WebGL and iOS, but fail on Android:

    Is there a definite fix for this? Seems like people are randomly tampering with things and eventually getting lucky.
     
  17. aollikai

    aollikai

    Joined:
    Jul 13, 2015
    Posts:
    2
    Having the same problem and any of the "solutions" above won't work. Waiting for a fix.
     
  18. pfleetwood22

    pfleetwood22

    Joined:
    Jun 6, 2016
    Posts:
    28
    Having the same issue on Android on CloudBuild.
     
  19. peter_planeto

    peter_planeto

    Joined:
    Mar 14, 2016
    Posts:
    2
    I also have this problem on Cloud Build
     
  20. peter_planeto

    peter_planeto

    Joined:
    Mar 14, 2016
    Posts:
    2
    Still happens in 5.6.1f1
     
  21. lexi89

    lexi89

    Joined:
    Dec 5, 2016
    Posts:
    4
    Same here - 5.6.0f3
     
  22. pfleetwood22

    pfleetwood22

    Joined:
    Jun 6, 2016
    Posts:
    28
    I think I might have fixed this problem by changing the ProjectSettings.asset file value for "facebookSdkVersion" to "plugin"
     
  23. YarivAtias

    YarivAtias

    Joined:
    Feb 27, 2017
    Posts:
    2
    blumersolutions solution's works for me as well.
    When I deleted the Facebook folder from Unity\Editor\Data\PlaybackEngines then unity did not created the file 'Library/FacebookSDK/Facebook.Unity.Settings.dll'.
    Actually it did not created any file related to 'Facebook' i Library folder.


     
  24. LOLinc

    LOLinc

    Joined:
    Nov 18, 2013
    Posts:
    28
    Same problem here using Facebook SDK to 7.9.4 using cloud build.
    Tried both using 5.6.3p and 5.6.1, same result.
    Any alternatives fixes for cloud build is very welcome!
     
  25. GravyGaming

    GravyGaming

    Joined:
    Nov 25, 2015
    Posts:
    8
    Same problem, now with 5.6.2f1 and with Facebook SDK 7.9.4, please anyone from Unity can help us with this problem?
     
  26. bogdan-hodorogea

    bogdan-hodorogea

    Joined:
    Nov 2, 2015
    Posts:
    8
    We're having a similar issue with our jenkins automated builder.
    Seems that building from command line is broken when the Facebook Gameroom module is installed and the Facebook SDK is added to the project, we tested building for both Android and iOS.

    Our solution was to uninstall the Gameroom platform from Unity, delete Library/FacebookSDK folder from the project and rebuild.
     
  27. GravyGaming

    GravyGaming

    Joined:
    Nov 25, 2015
    Posts:
    8
    In my case I didn't install the Facebook Gameroom and the problem happens anyway.
     
  28. Mybox

    Mybox

    Joined:
    Nov 8, 2015
    Posts:
    3
    An response from Unity guys? We are currently being unable to build a working FB integration as we are being unable to edit the FacebookSettings.asset

    Tried removing the Facebook folder from PlaybackEngines but same error persists.
     
  29. Mybox

    Mybox

    Joined:
    Nov 8, 2015
    Posts:
    3
    As a workaround, removing the Unity's "native" FacebookSettings.dll from the Library folder seems to do the trick. in mac should be:

    PROJECT_ROOT>Library>FacebookSDK
     
    Deftsoft1 likes this.
  30. Bruder

    Bruder

    Joined:
    Aug 9, 2014
    Posts:
    56
    Anyone knows if there is something new with this issue?
     
  31. sama-van

    sama-van

    Joined:
    Jun 2, 2009
    Posts:
    1,734
    Thanks!
    Error disappeared :)
     
    teexiii likes this.
  32. Bruder

    Bruder

    Joined:
    Aug 9, 2014
    Posts:
    56
    @sama-van , does this fix also the cloud build? (or just locally)
     
  33. rankornfeld

    rankornfeld

    Joined:
    Sep 29, 2016
    Posts:
    57
    Get the same error on iOS cloud build with Facebook SDK 7.10.0 and using "Latest 5.6" version..
     
  34. IonRift

    IonRift

    Joined:
    Jan 14, 2013
    Posts:
    16
    Same issue, iOS Cloud build, unity 5.6, Facebook 7.10
     
  35. rankornfeld

    rankornfeld

    Joined:
    Sep 29, 2016
    Posts:
    57
    I have found that even though I get this error, this is not what makes my build fail.
    My actual reason is a missing dylib link that I need for iOS...

    It seems that cloud build treats this more like a warning and not a critical error.
     
  36. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    345
    Same issue on iOS and Android cloud builds on Unity 2017.1.0f3 and Facebook 7.10
     
  37. Michieal

    Michieal

    Joined:
    Jul 7, 2013
    Posts:
    92
    A lot of the lack of response from Unity Technologies itself is the fact that Facebook made the Facebook SDK. And, Facebook changes their platform every Sunday. (If you watch the Platform Update stream on Facebook, you'll notice that Facebook regularly breaks their own service.) Their patch day is Wednesday (so from Sunday to Wednesday is a horrible time to try to use Facebook usually)... Having actually talked to people from Facebook, I have the distinct impression that they are great at php, but not so great at other programming languages. (Read: They didn't know their anatomy from holes in the ground, and offered no help even on the simplest of questions.)
    I would imagine that Unity is still waiting to hear back from Facebook, and Facebook is scratching their heads like monkeys.
    Anyway, Same issue here but with Facebook.Unity.Arcade.dll.
     
    MortePCAndVR likes this.
  38. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    345
    Is there any work around for the Cloud Build that actually works?
     
  39. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    345
    Android Builds appear to be working again, but still no luck on iOS builds.
     
  40. devotionsolutions

    devotionsolutions

    Joined:
    Feb 9, 2013
    Posts:
    40
    This is still broken on local builds for Unity 2017.1.0p5 + FB SDK 7.10..
     
    CostelloNicho likes this.
  41. devotionsolutions

    devotionsolutions

    Joined:
    Feb 9, 2013
    Posts:
    40
    Well, apparently if you remove the dll in Facebook.Unity.Gameroom.dll in \Assets\FacebookSDK\Plugins\Gameroom\Facebook.Unity.Gameroom.dll it also works, since it's now including the one on the Unity install. However, I'm not sure if there's any inconsistence because of the different versions..
     
  42. rankornfeld

    rankornfeld

    Joined:
    Sep 29, 2016
    Posts:
    57
    For me iOS is working and Android stopped working a few days ago...
    This seems to be inconsistent.
    Trying to remove the Facebook.Unity.Gameroom.dll and see what happens.
     
  43. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    345
    I tried removing it, didn't help.
     
  44. devotionsolutions

    devotionsolutions

    Joined:
    Feb 9, 2013
    Posts:
    40
    If you try with my previous workaround it actually works. Check this thread for more info
     
  45. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    345
    nope, the cloud build still fails. can you give me more details, what version you running of Unity and Facebook SDK?
     
  46. devotionsolutions

    devotionsolutions

    Joined:
    Feb 9, 2013
    Posts:
    40
    Sorry, didn't tried with cloud, only applies to local builds.
     
  47. devotionsolutions

    devotionsolutions

    Joined:
    Feb 9, 2013
    Posts:
    40
    On local: 2017.1.0p5 + FB SDK 7.10..
     
  48. tridentcanadainc

    tridentcanadainc

    Joined:
    Mar 8, 2017
    Posts:
    10
    Great tip, worked for us.
    Unity 5.6.1.f1, FB SDK 7.10.0
     
  49. PaulECoyote

    PaulECoyote

    Joined:
    Nov 21, 2013
    Posts:
    1
    Yep - made the same change using text editor in ./ProjectSettings/ProjectSettings.asset

    Funny thing is that is was set to
    facebookSdkVersion: 7.10

    then I saved while Unity editor was closed
    facebookSdkVersion: plugin

    But inspecting the file again it has gone back to
    facebookSdkVersion: 7.9.4

    ... since a build.

    Going in to the settings I get a little info area telling me to go in to player settings and set it to 7.10.1
    I think that's what I did when I got in to this mess in the first place.

    Also my app id and upload token also disappeared after making that "facebookSdkVersion: plugin" change.

    So as I've got the thing building and deploying again I'm going to leave it as-is for the moment.

    I didn't see a "plugin" option in the drop-down menu so I suspect when it encounters "plugin" it just resets down to that default 7.9.4 and clears the other settings. Absolutely no proof on that though.
     
    alphadogware likes this.
  50. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    345
    Pretty shocking the support level from Unity on this issue.