- Home /
IOS Cloud build linker problem - _OBJC_CLASS_$_NSBundleResourceRequest
Hi
I'm trying to build my game on IOS using Unity cloud build. Unfortunately i got some problems with linker and can't figure out how to fix them. This is part of the log from build:
18376: [xcode] Undefined symbols for architecture arm64:
18377: [xcode] "_OBJC_CLASS_$_NSBundleResourceRequest", referenced from:
18378: [xcode] objc-class-ref in libiPhone-lib.a(OnDemandResources.o)
18379: [xcode] ld: symbol(s) not found for architecture arm64
i tried to find something about that in google but have no good answer. Just before i got this error i started to use post process api to add some libraries needed by google analitics plugins (for the record did it for fix some other linker error). Maybe i made something wrong there? Maybe i have to add something similar? This is code i use
public static void OnPostprocessBuild(BuildTarget buildTarget, string path)
{
#if UNITY_IOS
Debug.Log("OnPostprocessBuildiOS");
string projPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
PBXProject proj = new PBXProject ();
proj.ReadFromString (File.ReadAllText (projPath));
string target = proj.TargetGuidByName ("Unity-iPhone");
// Set a custom link flag
proj.AddBuildProperty (target, "OTHER_LDFLAGS", "-all_load");
proj.AddBuildProperty (target, "OTHER_LDFLAGS", "-ObjC");
// add frameworks
proj.AddFrameworkToProject(target, "AdSupport.framework", true);
proj.AddFrameworkToProject(target, "CoreData.framework", true);
proj.AddFrameworkToProject(target, "SystemConfiguration.framework", true);
AddUsrLib(proj, target, "libz.dylib");
AddUsrLib(proj, target, "libsqlite3.dylib");
File.WriteAllText (projPath, proj.WriteToString ());
}
private static void AddUsrLib(PBXProject proj, string targetGuid, string framework)
{
string fileGuid = proj.AddFile("usr/lib/" + framework, "Frameworks/" + framework, PBXSourceTree.Sdk);
proj.AddFileToBuild(targetGuid, fileGuid);
#endif
}
i will be glad to hear any suggestions ;-).
I have the very same issues, I really need help as well!
Answer by BrianLedsworthGSN · Jan 08, 2016 at 05:04 PM
Had the same issue with an third party SDK, and I found that removing "-all_load" from OTHER_LDFLAGS fixed the compilation error. Have not tested yet to see if removing that affected anything else!
Answer by BrianLedsworthGSN · Jan 11, 2016 at 03:17 PM
I removed the "-all_load" linker flag and it fixed it for me.
Answer by meti314 · Jan 08, 2016 at 06:43 PM
Thanks :) this solved my problem :). Documentation says that this flag forces to load all forces the linker to load all object files from every archive it sees, even those without Objective-C, hopefully if it builds without them it won't affect the game :).
Your answer
Follow this Question
Related Questions
Build with in-app purchase 1 Answer
Distribute terrain in zones 3 Answers
put build on website to send to testers ios? 0 Answers
Cloud Build warning: Can't find custom attr constructor image 2 Answers