Mos*_*erA 7 xcode unity-game-engine ios
在我的 Unity 项目中,我之前进行了几次构建,都没有出现问题。然而,在此版本中,我集成了 Facebook SDK,然后当我在 Xcode 工作区存档后尝试上传它时,开始出现此错误 (image1)。
我也尝试用 Transporter 上传它,但 Transporter 也抛出错误(image2)。
当我为 IOS unity 构建项目时,会创建一些文件,并在那里找到一个 UnityFramework 文件夹,我认为该文件夹是错误中提到的文件夹。但是,该文件夹中只有 2 个文件,并且没有一个文件名为“Frameworks”(image3)。
使用 Android 版本的应用程序,一切都很好。此问题仅在 IOS 版本中出现。
Exp*_*ion 11
下面直观地展示了您应该如何解决"contains disallowed file 'Frameworks'" errors从 Unity 导出的 XCode 项目
或者
如果您不想在每次构建时手动配置此操作,您可以在项目中添加此脚本,以便在每次构建时自动执行此操作:
using System;
using UnityEditor;
#if UNITY_IOS
using UnityEditor.iOS.Xcode;
#endif
using UnityEditor.Callbacks;
namespace SomeEditorNameSpace
{
// Automatically set the "Always Embed Swift Standard Libraries" option to "No" in UnityFramework Target in XCode
public static class DisableEmbedSwiftLibs
{
[PostProcessBuildAttribute(Int32.MaxValue)] //We want this code to run last!
public static void OnPostProcessBuild(BuildTarget buildTarget, string pathToBuildProject)
{
#if UNITY_IOS
if (buildTarget != BuildTarget.iOS) return; // Make sure its iOS build
// Getting access to the xcode project file
string projectPath = pathToBuildProject + "/Unity-iPhone.xcodeproj/project.pbxproj";
PBXProject pbxProject = new PBXProject();
pbxProject.ReadFromFile(projectPath);
// Getting the UnityFramework Target and changing build settings
string target = pbxProject.GetUnityFrameworkTargetGuid();
pbxProject.SetBuildProperty(target, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "NO");
// After we're done editing the build settings we save it
pbxProject.WriteToFile(projectPath);
#endif
}
}
}
Run Code Online (Sandbox Code Playgroud)
然后您可以存档并验证您的构建,不会出现任何错误。希望我的回答有帮助。
| 归档时间: |
|
| 查看次数: |
7704 次 |
| 最近记录: |