Search Unity

2017.4.20f2 Cloud build ios suddently has error with postprocess script

Discussion in 'Unity Build Automation' started by sang, Jul 10, 2019.

  1. sang

    sang

    Joined:
    Jul 17, 2013
    Posts:
    10
    It was working 1 week ago and now it's not.

    I have a script to add Notification:
    Code (CSharp):
    1. public static void AddUserNotificationFramework(string projectPath)
    2.     {
    3.         Debug.LogError("AddUserNotificationFramework");
    4.         #if UNITY_IOS
    5.         string pbxProjectPath = projectPath + "/Unity-iPhone.xcodeproj/project.pbxproj";
    6.         PBXProject proj = new PBXProject();
    7.         proj.ReadFromFile(pbxProjectPath);
    8.  
    9.         string targetName = PBXProject.GetUnityTargetName ();
    10.         string guid = proj.TargetGuidByName (targetName);
    11.         proj.AddFrameworkToProject(guid, "UserNotifications.framework", false);
    12.  
    13.         ProjectCapabilityManager projCapManager = new ProjectCapabilityManager(pbxProjectPath, "ios.entitlements", "Unity-iPhone");
    14.         projCapManager.AddBackgroundModes(BackgroundModesOptions.RemoteNotifications);
    15.         #if Preview
    16.         projCapManager.AddPushNotifications(true);
    17.         #else
    18.         projCapManager.AddPushNotifications(false);
    19.         #endif
    20.         projCapManager.WriteToFile();
    21.         proj.WriteToFile (pbxProjectPath);
    22.         #endif
    23.     }
    But the cloud build say it can't copy file

    [Unity] ERROR: PostProcessIOS
    1156: [Unity] ERROR: AddUserNotificationFramework
    1157: [Unity] ERROR: File Library/Unused/eda03f975aaff4c86a29c2aa2e2ba88b couldn't be written. Because moving /BUILD_PATH/mission-one.ninja-wars.preview-php-ios/Temp/UnityTempFile-f0d80ee6b2db14859a734411d62ce5d6 to /BUILD_PATH/Library/Preferences/Unity/Editor-5.x/Layouts/LastLayout.dwlt failed.
    1158: [Unity] ERROR: File Library/Unused/eda03f975aaff4c86a29c2aa2e2ba88b couldn't be written. Because moving /BUILD_PATH/mission-one.ninja-wars.preview-php-ios/Temp/UnityTempFile-14cb7fca1cadf4d3da821ddb3a3e5876 to /BUILD_PATH/Library/Preferences/Unity/Editor-5.x/Layouts/LastLayout.dwlt failed.

    It's still working on local build.
    Anyone know why or how to fix it? Thanks a lot.