1、build时报错,提示找不到*.a的库文件
确认Unity项目里是否有该*.a的库文件,svn上传代码时会忽略*.a文件
2、build时提示xxx does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE BITCODE), obtain an updated library fromthe vendor, or disable bitcode for this target, for architecture arm64
方法1、可以在TARGETS里的项目中,在Build Settings -> All 下,将Enable Bitcode改为No
方法2、将以下代码保存到Editor目录下,用代码修改Enable BitCode。
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;
#if UNITY_IOS
using UnityEditor.iOS.Xcode;
class MyPostProcessor : IPostprocessBuildWithReport
{
public int callbackOrder { get { return 0; } }
public void OnPostprocessBuild(BuildReport report)
{
if (report.summary.platform == BuildTarget.iOS)
{
string projectPath = report.summary.outputPath + "/Unity-iPhone.xcodeproj/project.pbxproj";
PBXProject pbxProject = new PBXProject();
pbxProject.ReadFromFile(projectPath);
//Disabling Bitcode on all targets
//Main
string target = pbxProject.GetUnityMainTargetGuid();
pbxProject.SetBuildProperty(target, "ENABLE_BITCODE", "NO");
//Unity Tests
target = pbxProject.TargetGuidByName(PBXProject.GetUnityTestTargetName());
pbxProject.SetBuildProperty(target, "ENABLE_BITCODE", "NO");
//Unity Framework
target = pbxProject.GetUnityFrameworkTargetGuid();
pbxProject.SetBuildProperty(target, "ENABLE_BITCODE", "NO");
pbxProject.WriteToFile(projectPath);
}
}
}
#endif
3、Unity接入AppleSignInUnity时,要注意登录代码类需要继承MonoBehaviour,因为Apple登录的回调处理是在Update函数下检测处理的
4、苹果内购测试需要先填写Banking和Tax信息,不然填了内购商品也没法测
5、使用EMDU(External Dependency Manager for Unity)时,需要取消Always add the main target to Podfile的勾选,不然他会把Pod_Unity_Phone.framework添加到Build Phases下的Link Binary With Libraries里,而在build或archive时会报错说找不到Pod_Unity_Phone.framework