skip to Main Content

After Build the Xcode Project with Unity, my Unity-iphone Target’s Team have set to my team.
But when I archive project, it shows errors. It is FBSDKCoreKit-FacebookSDKStrings need set team. How do I set it automatically? So I don’t need to set it after every build?
enter image description here

2

Answers


  1. You can create a file postProcessoriOS.cs and put it into Assets / Editor in Unity (create the Editor folder if you don’t have one already).

    Remember to replace YOUR TEAM ID below with your team ID, which can be found here.

    #if UNITY_IOS
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEditor;
    using UnityEditor.Callbacks;
    using UnityEditor.iOS.Xcode;
    using System.IO;
    
    public class postProcessoriOS : MonoBehaviour
    {
          [PostProcessBuild( 45 )]//must be between 40 and 50 to ensure that it's not overriden by Podfile generation (40) and that it's added before "pod install" (50)
      public static void FixPodFile( BuildTarget buildTarget, string buildPath )
      {
            if (buildTarget != BuildTarget.iOS)
            {
                return;
            }
          using (StreamWriter sw = File.AppendText( buildPath + "/Podfile" ))
          {
              sw.WriteLine("post_install do |installer|");
              sw.WriteLine("installer.generated_projects.each do |project|");
              sw.WriteLine("project.targets.each do |target|");
              sw.WriteLine("target.build_configurations.each do |config|");
              sw.WriteLine("config.build_settings["DEVELOPMENT_TEAM"] = " YOUR TEAM ID "");
              sw.WriteLine("endnendnendnend");
          }
      }
     
    }
    #endif
    
    Login or Signup to reply.
  2. You can also disable signing for plugin pods, that should not require your signing in my opinion. You can do this with the same kind of post processing:

        // Callback order must be between 40 and 50 to ensure that it's not overriden by Podfile generation (40) and that it's added before "pod install" (50)
        [PostProcessBuild(45)]
        public static void FixPodFile(BuildTarget buildTarget, string buildPath)
        {
            using var sw = File.AppendText(buildPath + "/Podfile");
            sw.WriteLine("post_install do |installer|");
            sw.WriteLine("installer.pods_project.targets.each do |target|");
            sw.WriteLine("target.build_configurations.each do |config|");
            sw.WriteLine("config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = """);
            sw.WriteLine("config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"");
            sw.WriteLine("config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"");
            sw.WriteLine("endnendnend");
        }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search