Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Got "library not found for -liPhone-lib" error after Unity update

Discussion in 'iOS and tvOS' started by rusildo, Oct 13, 2019.

  1. rusildo

    rusildo

    Joined:
    Oct 10, 2014
    Posts:
    18
    After switching to a new version Unity from 2018.4.10 to 2018.4.11 got an error during build (see screenshot). On version 2019.2.9 the same error. What should I do?

    Tested on
    Xcode 11.1
    macOS 10.15
    Unity 2018.4.11 & 2019.2.9 (Windows version)
     

    Attached Files:

  2. geretti

    geretti

    Joined:
    Dec 20, 2016
    Posts:
    10
    Got the same issue here. Upgraded from 2018.4.7f1 to 2018.4.11f1.

    I fixed the issue by adding $(SRCROOT)/Libraries/** (the 2 asterisks mean recursively) to the
    LIBRARY_SEARCH_PATHS key in the target.

    Here's the equivalent post processing code:

    Code (CSharp):
    1.         [PostProcessBuild]
    2.         public static void OnPostProcessBuild(BuildTarget target, string pathToBuildProject)
    3.         {
    4. #if UNITY_IOS
    5.             PBXProject proj = new PBXProject();
    6.             string pbxFilename = pathToBuildProject + "/Unity-iPhone.xcodeproj/project.pbxproj";
    7.             proj.ReadFromFile(pbxFilename);
    8.  
    9.             string targetName = PBXProject.GetUnityTargetName();
    10.             string guid = proj.TargetGuidByName(targetName);
    11.        
    12.             proj.AddBuildProperty(guid, "LIBRARY_SEARCH_PATHS", "$(SRCROOT)/Libraries/**");
    13.  
    14.             proj.WriteToFile(pbxFilename);
    15. #endif
    16.         }
    This should be bugged on Unity's side. It's likely been caused by the other iOS publishing fixes they've made on Unity 2018.4.11f1: https://unity3d.com/unity/whats-new/2018.4.11 more specifically this one: https://issuetracker.unity3d.com/is...06.441669281.1570835463-1873919127.1536875995
     
    Last edited: Oct 14, 2019
    rusildo likes this.
  3. ArnoBen

    ArnoBen

    Joined:
    Apr 24, 2019
    Posts:
    13
    @geretti Hi, I have the same issue and kind of tried your solution but I'm not sure I did it well because I still have the error.
    Basically I simply added the line
     proj.AddBuildProperty(targetGUID, "LIBRARY_SEARCH_PATHS", "$(SRCROOT)/Libraries/**");

    at the end of the OnPostProcessBuild method. It's at line 137 in the script https://pastebin.com/hpsCggqW
    Is there something I'm doing wrong? Also, has Unity adressed this issue yet ?
    Thanks in advance.
     
  4. jimjimimjimmy

    jimjimimjimmy

    Joined:
    Jul 11, 2013
    Posts:
    4
    same here ,how to fixed it

    unity 2018.4.16
    xcode 13.1