赞
踩
Error loading /var/containers/Bundle/Application/61CD0810-9E62-452B-8129-3DAC706B56C5/HarvestBumpers.app/Frameworks/UnityFramework.framework/UnityFramework: dlopen(/var/containers/Bundle/Application/61CD0810-9E62-452B-8129-3DAC706B56C5/HarvestBumpers.app/Frameworks/UnityFramework.framework/UnityFramework, 0x0109): dependent dylib '/System/Library/Frameworks/AdServices.framework/AdServices' not found for '/private/var/containers/Bundle/Application/61CD0810-9E62-452B-8129-3DAC706B56C5/HarvestBumpers.app/Frameworks/UnityFramework.framework/UnityFramework'
问题出现在AdServices' not found,缺少AdServices.framework文件
iOS 13.6闪退,iOS 15.1/15.5正常
接入的iOS SDK中需要手动添加库/框架,其中AdServices是可选的,仅支持14.3及以上版本iOS。
实际设置为了必选的,导致低版本iOS异常。
将AdServices.framework设置为可选项:
方式一:直接修改XCode工程,将Required改为Optional
方式二:Unity打包后处理,false改为true
project.AddFrameworkToProject(frameGuid,"AdServices.framework",true)
- using UnityEngine;
- using UnityEditor;
- using UnityEditor.Build;
- using UnityEditor.Build.Reporting;
- using UnityEditor.Callbacks;
- using System.IO;
- using System.Linq;
- #if UNITY_EDITOR_OSX
- using UnityEditor.iOS.Xcode;
- #endif
-
- public class BuildCallback1
- {
- //回调 打包后操作
- [PostProcessBuild(1)]
- private static void PostProcessBuildCallback(BuildTarget target,string projectPath)
- {
- if(target == BuildTarget.iOS)
- {
- #if UNITY_EDITOR_OSX
- AfterBuild_IOS(projectPath);
- #endif
- }
- }
-
- #if UNITY_EDITOR_OSX
- private static void AfterBuild_IOS(string projectPath)
- {
- //修改设置属性
- string projPath = PBXProject.GetPBXProjectPath(projectPath);
- PBXProject project = new PBXProject();
- project.ReadFromString(File.ReadAllText(projPath));
-
- string frameGuid = project.GetUnityFrameworkTargetGuid();
-
- //True if the framework is optional (i.e. weakly linked), false if the framework is required.
- project.AddFrameworkToProject(frameGuid,"AdServices.framework",true);
-
- /*
- * 其他后处理操作
- */
-
- File.WriteAllText(projPath,project.WriteToString());
-
- Debug.Log("Xcode 后续处理完成");
- }
- #endif
-
- }

赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。