Search Unity

no reference to libiconv.2.dylib on Xcode 7

Discussion in 'iOS and tvOS' started by van_ustwo, Sep 10, 2015.

  1. van_ustwo

    van_ustwo

    Joined:
    Jul 10, 2012
    Posts:
    82
    libiconv.2.dylib is shown red in Xcode 7. Is this safe to ignore. I understand that Apple has changed dylib to tbd.
     
  2. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Yes, it should be safe to ignore.
     
  3. greg-harding

    greg-harding

    Joined:
    Apr 11, 2013
    Posts:
    524
    We just hit this problem and couldn't build without removing 'libiconv.2.dylib' and adding 'libiconv.2.tdb' in Xcode.
     
  4. Nabil_fx

    Nabil_fx

    Joined:
    Nov 9, 2013
    Posts:
    124
    iam building a project in Xcode from Unity, but the registration and login script, does not work. Here the xcode message

    2015-10-15 15:57:41.510 RankingSystem[5179:2091125] -> registered mono modules 0x100ec9b00

    -> applicationDidFinishLaunching()

    -> applicationDidBecomeActive()

    Requesting Resolution: 1080x1920

    Init: screen size 1080x1920

    Initializing Metal device caps

    Initialize engine version: 5.2.0f3 (e7947df39b5c)

    Setting up 1 worker threads for Enlighten.

    Thread -> id: 16e8a7000 -> priority: 1
     
  5. McKrackeN

    McKrackeN

    Joined:
    Oct 28, 2009
    Posts:
    51
    We're having the same issue here and we need to build the project automatically, but there's no way to remove libiconv.2.dylib and add libiconv.2.tbd from post process script. Is there any other workaround for this problem?

    Here's the post-process script we're using:

    Code (CSharp):
    1.     public static void OnPostprocessBuild(BuildTarget buildTarget, string path) {
    2.      
    3.         if (buildTarget == BuildTarget.iOS) {
    4.             string projPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
    5.          
    6.             PBXProject proj = new PBXProject();
    7.             proj.ReadFromString(File.ReadAllText(projPath));
    8.          
    9.             string target = proj.TargetGuidByName("Unity-iPhone");
    10.  
    11.             proj.RemoveFrameworkFromProject(target, "libiconv.2.dylib");        
    12.             proj.AddFrameworkToProject(target,"libiconv.2.tbd", false);
    13.          
    14.             // Set a custom link flag
    15.             proj.AddBuildProperty(target, "OTHER_LDFLAGS", "-ObjC");
    16.          
    17.             File.WriteAllText(projPath, proj.WriteToString());
    18.         }
    19. }
     
    Last edited: Nov 20, 2015
  6. McKrackeN

    McKrackeN

    Joined:
    Oct 28, 2009
    Posts:
    51
    Nevermind, I found a way to workaround this issue. Here's the fixed post-process script:

    Code (CSharp):
    1.     [PostProcessBuild]
    2.     public static void OnPostprocessBuild(BuildTarget buildTarget, string path) {
    3.      
    4.         if (buildTarget == BuildTarget.iOS) {
    5.             string projPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
    6.          
    7.             PBXProject proj = new PBXProject();
    8.             proj.ReadFromString(File.ReadAllText(projPath));
    9.          
    10.             string target = proj.TargetGuidByName("Unity-iPhone");
    11.          
    12.             proj.RemoveFrameworkFromProject(target, "libiconv.2.dylib");          
    13.          
    14.             // Set a custom link flag
    15.             proj.AddBuildProperty(target, "OTHER_LDFLAGS", "-ObjC -liconv");
    16.          
    17.             File.WriteAllText(projPath, proj.WriteToString());
    18.         }
    19.     }
    Edit: By the way, removing libiconv.2.dylib using RemoveFrameworkFromProject method doesn't do anything, but it builds successfully anyway.

    Cheers!
     
  7. greg-harding

    greg-harding

    Joined:
    Apr 11, 2013
    Posts:
    524
    Nice automation, @McKrackeN. I should have been far less lazy myself and made and posted something earlier. I haven't exported from the latest Unity 5.2.3f1 yet (there were a lot of fixes in the release notes) but if it hasn't been fixed then I'm going to be 'heavily inspired by' your code snippet :)

    // greg
     
  8. McKrackeN

    McKrackeN

    Joined:
    Oct 28, 2009
    Posts:
    51
    Thanks for your comments. I'm about to test it with version 5.2.3f1, so I'll get back to you with the results. ;)
     
  9. McKrackeN

    McKrackeN

    Joined:
    Oct 28, 2009
    Posts:
    51
    It worked flawlessly with version 5.2.3f1. :D
     
  10. FatIgor

    FatIgor

    Joined:
    Sep 13, 2015
    Posts:
    29
    OK. This may sound really dim, but how and where do I use this?

     
  11. greg-harding

    greg-harding

    Joined:
    Apr 11, 2013
    Posts:
    524