Hey guys and thanks for any help provided.
I have a fairly simple post process build method which I added line by line to slowly get rid of errors building in Unity Cloud:
[PostProcessBuild]
public static void OnPostprocessBuild(BuildTarget buildTarget, string pathToBuiltProject)
{
#if UNITY_IOS
string projPath = pathToBuiltProject + "/Unity-iPhone.xcodeproj/project.pbxproj";
PBXProject proj = new PBXProject ();
proj.ReadFromString (File.ReadAllText (projPath));
string target = proj.TargetGuidByName ("Unity-iPhone");
proj.AddBuildProperty (target, "OTHER_LDFLAGS", "-ObjC");
proj.SetBuildProperty(target, "ENABLE_BITCODE", "NO");
proj.SetBuildProperty(target, "Architectures", "armv7");
proj.AddFrameworkToProject(target, "AdSupport.framework", true);
proj.AddFrameworkToProject(target, "CoreData.framework", true);
proj.AddFrameworkToProject(target, "SystemConfiguration.framework", true);
proj.AddFileToBuild(target, proj.AddFile("usr/lib/libz.tbd", "Frameworks/libz.tbd", PBXSourceTree.Sdk));
proj.AddFileToBuild(target, proj.AddFile("usr/lib/libsqlite3.tbd", "Frameworks/libsqlite3.tbd", PBXSourceTree.Sdk));
File.WriteAllText (projPath, proj.WriteToString ());
#endif
}
Unfortunately the final line I added:
proj.AddFileToBuild(target, proj.AddFile("usr/lib/libsqlite3.tbd", "Frameworks/libsqlite3.tbd", PBXSourceTree.Sdk));
didn’t seem to remove it’s related linker errors:
I am using latest XCode version and latest Unity.
I don’t think sqlite is being added to the build. BTW - this can run perfectly on your local machine, so you can test it prior to using it in cloud build.
Here’s the code we use to add a library (.tbd) for iOS:
proj.AddFileToBuild(targetGUID, proj.AddFile("usr/lib/libicucore.tbd", "Frameworks/libicucore.tbd", PBXSourceTree.Sdk));
proj.AddFileToBuild(targetGUID, proj.AddFile("usr/lib/libicucore.tbd", "Frameworks/libicucore.tbd", PBXSourceTree.Build));
You may be missing the other line (where you add it using PBXSourceTree.Build)
Thanks for the reply.
Yes I agree the sqlite library isn’t being linked and I do see that it copied locally into Frameworks/libsqlite3.tbd but it isn’t added to ‘Link Binary With Libraries’ that’s what I am having an issue with. (Even with your added line, which from my research shouldn’t be required)
I can also see that libz.tbd is not added to “link binary with libraries”… but it’s still there under “Frameworks”.
What you can do, is manually perform the steps needed in Xcode, and then try to reverse engineer how it was saved in your .pbxproj file and apply those changes in your Unity processor code.
BTW: what Unity version are you using? the support for adding .tbd files was not there all along. I added that code as a pull request to the XcodeAPI project, i can’t recall when it was added.
Yeah, both tbds are not added.
Really hoping I don’t have to reverse engineer the pbxproj file. 
Yeah I am using Unity 5.4.0f3 locally and whatever the latest one is in Unity Cloud.
Unity 5.4.0f3 should already have that fix added.
Analyzing the FileTypeUtils (under UnityEditor.iOS.Xcode.PBX), it seems that my fix was not merged into the XcodeAPI that is shipped with Unity after all:

I can’t find any handling for the .tbd file type … @povilas can you please comment on that ?
I see it was merged but not shipped. I might just grab the source with your change applied and use it instead.
Unity 5.4.0 patch 4 release notes now mention they support .tbd files (finally): Download Archive