public static void AddLocaleVariantFile(this PBXProject project, string groupName, string code, string path)
        {
            /// Replaces '\' with '/'. We need to apply this function to all paths that come from the user
            /// of the API because we store paths to pbxproj and on windows we may get path with '\' slashes
            /// instead of '/' slashes
            path = path.Replace('\\', '/');

            // Get or create the variant group
            var    variantGroups      = s_ProjectVariantGroups.GetValue(project);
            var    variantGroupValues = s_VariantGroupsObjects.Invoke(variantGroups, null) as ICollection;
            object group = null;

            foreach (var g in variantGroupValues)
            {
                var name = s_VariantGroupName.GetValue(g) as string;
                if (name == groupName)
                {
                    group = g;
                }
            }

            if (group == null)
            {
                var guid = Guid.NewGuid().ToString("N").Substring(8).ToUpper();

                group = Activator.CreateInstance(s_PBXVariantGroupData);
                s_VariantGroupName.SetValue(group, groupName);
                s_GroupPath.SetValue(group, groupName);
                s_PBXObjectGuid.SetValue(group, guid);
                s_GroupChildren.SetValue(group, Activator.CreateInstance(s_GUIDList));
                s_VariantGroupsSetPropertyString.Invoke(group, new object[] { "isa", "PBXVariantGroup" });

                s_VariantGroupsAddEntry.Invoke(variantGroups, new object[] { group });
            }

            var targetGuid = project.GetUnityMainTargetGuid();
            var groupGuid  = s_PBXObjectGuid.GetValue(group) as string;

            var buildFileData = s_ProjectBuildFilesGetForSourceFile.Invoke(project, new object[] { targetGuid, groupGuid });

            if (buildFileData == null)
            {
                var customData = project.GetGroupByName("CustomTemplate");
                var children   = s_GroupChildren.GetValue(customData);
                s_GuidListAdd.Invoke(children, new object[] { groupGuid });

                var buildFileGuid  = project.AddFileRefToBuild(project.GetUnityMainTargetGuid(), groupGuid);
                var buildPhaseGuid = project.GetResourcesBuildPhaseByTarget(targetGuid);
                project.AddFileToResourceBuildPhase(buildPhaseGuid, buildFileGuid);
            }

            // Add the file if it has not already been added
            var fileRef = project.GetFileRefDataByPath(path);

            if (fileRef == null)
            {
                fileRef = s_FileRefDataCreateFromFile.Invoke(null, new object[] { path, code, PBXSourceTree.Source });
                s_ProjectFileRefsAdd.Invoke(project, new object[] { path, code, group, fileRef });
            }

            // Add the file to the variant group
            var fileRefsGuid  = s_PBXObjectGuid.GetValue(fileRef) as string;
            var groupChildren = s_GroupChildren.GetValue(group);
            var res           = (bool)s_GUIDListContains.Invoke(groupChildren, new object[] { fileRefsGuid });

            if (!res)
            {
                s_GuidListAdd.Invoke(groupChildren, new[] { fileRefsGuid });
            }
        }