iOS build fails with clang: error: linker command failed with exit code 1 (use -v to see invocation)

Hello, the cloud build for iOS for our project fails with the following messge:
[xcode] clang: error: linker command failed with exit code 1 (use -v to see invocation)

This happens only on iOS build, Android builds successfully and the app runs as expected. Since the application is built with Unity 5.3.6, this is also the version, which is set up in the cloud build and results in the error above. The full log is pretty long (almost 9k lines), but near the error is the following:

8951: [xcode] Undefined symbols for architecture armv7:
8952: [xcode] “OBJC_CLASS_FIRDynamicLinks", referenced from: 8953: [xcode] objc-class-ref in libInvites.a(invites_receiver_internal_ios_1230d75baa8748d15aaa58c8ca55fdb3.o) 8954: [xcode] "_OBJC_CLASS__FIRInvitesTargetApplication”, referenced from:
8955: [xcode] objc-class-ref in libInvites.a(invites_sender_internal_ios_5a5f1fae9c2e05cb8ca5aae49485e16f.o)
8956: [xcode] “OBJC_CLASS_FIRApp", referenced from: 8957: [xcode] objc-class-ref in libApp.a(app_ios_3c1f2f5540e3edfbae8c7bf918ae5900.o) 8958: [xcode] "_OBJC_CLASS__GIDSignIn”, referenced from:
8959: [xcode] objc-class-ref in libInvites.a(invites_sender_internal_ios_5a5f1fae9c2e05cb8ca5aae49485e16f.o)
8960: [xcode] objc-class-ref in libInvites.a(invites_receiver_internal_ios_1230d75baa8748d15aaa58c8ca55fdb3.o)
8961: [xcode] “OBJC_CLASS_FIRInvites", referenced from: 8962: [xcode] objc-class-ref in libInvites.a(invites_sender_internal_ios_5a5f1fae9c2e05cb8ca5aae49485e16f.o) 8963: [xcode] objc-class-ref in libInvites.a(invites_receiver_internal_ios_1230d75baa8748d15aaa58c8ca55fdb3.o) 8964: [xcode] "_OBJC_CLASS__FIROptions”, referenced from:
8965: [xcode] objc-class-ref in libApp.a(app_ios_3c1f2f5540e3edfbae8c7bf918ae5900.o)
8966: [xcode] ld: symbol(s) not found for architecture armv7
8967: [xcode] clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any idea why this is happening and how to proceed?

Missing firebase framework for IOS.
You can add framework like this in a postbuild method (see UCB doc) Unity Build Automation

For instance:

[PostProcessBuild(101)]
    public static void OnPostprocessBuild(BuildTarget buildTarget, string buildPath) {

        Debug.Log ("Post Process Custom");

        // BuiltTarget.iOS is not defined in Unity 4, so we just use strings here
        if (buildTarget.ToString () == "iOS" || buildTarget.ToString () == "iPhone") {
            Debug.Log("Post Process Custom IOS");
            string projPath = buildPath + "/Unity-iPhone.xcodeproj/project.pbxproj";
//#if UNITY_IOS
            PBXProject proj = new PBXProject();
            proj.ReadFromString(File.ReadAllText(projPath));

            string target = proj.TargetGuidByName("Unity-iPhone");
            //Google Analytics
            proj.AddFrameworkToProject(target, "CoreData.framework", false);

            // 
            proj.AddFileToBuild(target, proj.AddFile("usr/lib/libsqlite3.0.tbd", "Frameworks/libsqlite3.0.tbd", PBXSourceTree.Sdk));

            //adcolony
            proj.AddFileToBuild(target, proj.AddFile("usr/lib/libz.1.2.5.tbd", "Frameworks/libz.1.2.5.tbd", PBXSourceTree.Sdk));
            //proj.AddBuildProperty(target, "CODE_SIGN_ENTITLEMENTS", PBXProject.GetUnityTargetName()+"/"+)
            //Firebase
            //proj.AddFrameworkToProject(target, "UserNotifications.framework", false);


            File.WriteAllText(projPath, proj.WriteToString());

            // Get plist
            string plistPath = buildPath + "/Info.plist";
            PlistDocument plist = new PlistDocument();
            plist.ReadFromString(File.ReadAllText(plistPath));

            // Get root
            PlistElementDict rootDict = plist.root;
            // Change value of CFBundleVersion in Xcode plist
            var buildKey = "UIBackgroundModes";
            rootDict.CreateArray (buildKey).AddString ("remote-notification");

            buildKey = "NSPhotoLibraryUsageDescription";
            rootDict.SetString(buildKey, "Some ad content may require access to the photo library.");
            //buildKey = "NSCameraUsageDescription";
            //rootDict.SetString(buildKey, "Some ad content may access camera to take picture.");
            buildKey = "NSMotionUsageDescription";
            rootDict.SetString(buildKey, "Some ad content may require access to accelerometer for interactive ad experience.");
            buildKey = "NSCalendarsUsageDescription";
            rootDict.SetString(buildKey, "Some ad content may create a calendar event.");
            // Write to file
            File.WriteAllText(plistPath, plist.WriteToString());
//#endif
        }


    }

But Firebase will use POD and UCB does not allow POD config. You must build locally if you use firebase.

Thank you for the prompt reply!
Meaning build locally in unity and then directly upload from xcode, right?

Any idea if there is any sharing framework, which would allow us to use cloud build? We REALLY LOVE IT!! :slight_smile: