Search Unity

Facebook SDK Build: couldn't parse contents....

Discussion in 'Scripting' started by OceanBlue, Nov 19, 2013.

  1. OceanBlue

    OceanBlue

    Joined:
    May 2, 2013
    Posts:
    251
    Hi

    I'm integrating the new Facebook SDK into my iPhone game, and I keep getting this issue....

    I have to build NEW every single time (rather than append after the first build). If I do an append build, I get this error:

    "Couldn't parse contents of Info.plist': The data couldn’t be read because it isn’t in the correct format.


    Am I doing something wrong? Doing a new build every time is a pain because it means having to setup Xcode and Localization files etc....

    Thanks for any direction on this.
     
  2. jarl-ostensen

    jarl-ostensen

    Joined:
    Oct 18, 2013
    Posts:
    17
    This is not a solution and we're trying to figure it out as well but; I can confirm that we have the same problem. We thought it had to do with Prime[31]'s update, are you using any of their plug-ins?

    Specifically: in the Info.plist file for our build there's a stray </string> which throws up the error.
     
    Last edited: Dec 3, 2013
  3. Jason-King

    Jason-King

    Joined:
    Oct 28, 2010
    Posts:
    56
    When building for iOS, the Info.plist may be corrupted whenever Default Orientation is set to Auto Rotation. The Info.plist file is created properly on the first build, but subsequent builds results in...

    <key>UIInterfaceOrientation</key>
    <string></string>
    </string>

    ... at this point Xcode fails to build the project.
     
  4. Dotmix

    Dotmix

    Joined:
    Feb 2, 2014
    Posts:
    1
    If it understand this right, this means that each time i build->append the FB keys will not be written into info.plist? (in addition for it being corrupted)
    is there a bug report about this in unity?

    the only work around for this right now is to build->replace each time?
     
  5. jarl-ostensen

    jarl-ostensen

    Joined:
    Oct 18, 2013
    Posts:
    17
    Yes, it seems so. to work around this I've created a build pipeline for our projects (custom BuildPipeline wrapper) which deletes the Info.plist file if you select "Append" - this forces it to recreate it even when building with option "AcceptExternalModificationsToPlayer" (https://docs.unity3d.com/Documentat...ions.AcceptExternalModificationsToPlayer.html )
     
  6. kayy

    kayy

    Joined:
    Jul 26, 2011
    Posts:
    110
    I found out that Info.plist gets corrupted only if it was modified before by shell commands. I had a script as Build Pre-action in Xcode containing:
    defaults write $mydomain UIRequiredDeviceCapabilities -array-add "gyroscope"​

    After this was executed once, every subsequent build in Append mode failed.

    On the other hand modifying Info.plist manually in Xcode works without problems. That means, if you just have some keys needed to added once, do the manipulation by hand in Xcode editor save it and that's it. If you need more control use a custom build pipeline to delete Info.plist like jarl.ostensen mentioned.
    I wrote a small blog post about this hassle including a code snippet for a custom pipeline. And I filed a bug report to Unity.
     
  7. mushdevstudio

    mushdevstudio

    Joined:
    May 9, 2014
    Posts:
    37
    OK it is a problem with the info.plist file.

    To replicate this run this command "plutil info.plist" from terminal in the directory where info.plist is located.

    For me it then told me that " Encountered unexpected character [ on line 2 while parsing inline DTD"

    So because i could not edit the info.plist in Xcode (I was getting a "The data couldn't be read because it isn't in the correct format" dialog box) - I opened the info.plist file with textedit and removed the second line "<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"[]>"

    After that all was good and the build worked fine.