uni-app打包IOS报错:[PackagePath]/HBuilder.xcodeproj: error: Provisioning profile \"uni.UNI12233 AdHoc AGDS\" doesn't support the Associated Domains capability

uni-app开发的app打包IOS报错,部分关键错误信息如下:

note: Building targets in dependency order
[PackagePath]/HBuilder.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.4.99. (in target 'HBuilder' from project 'HBuilder')
[PackagePath]/HBuilder.xcodeproj: error: Provisioning profile \"uni.UNI12233 AdHoc AGDS\" doesn't support the Associated Domains capability. (in target 'HBuilder' from project 'HBuilder')
[PackagePath]/HBuilder.xcodeproj: error: Provisioning profile \"uni.UNI12233 AdHoc AGDS\" doesn't include the com.apple.developer.associated-domains entitlement. Profile qualification is using entitlement definitions that may be out of date. Connect to network to update. (in target 'HBuilder' from project 'HBuilder')
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking \"Based on dependency analysis\" in the script phase. (in target 'HBuilder' from project 'HBuilder')2023-11-21 19:51:01.140 xcodebuild[24033:1675131] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
{ platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:00008112-000D29A41AFB401E }
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
{ platform:iOS Simulator, id:AF7F5F12-29C4-4CDB-A8D4-5603948745DB, OS:16.4, name:iPad (10th generation) }
{ platform:iOS Simulator, id:AF7F5F12-29C4-4CDB-A8D4-5603948745DB, OS:16.4, name:iPad (10th generation) }
{ platform:iOS Simulator, id:224291B0-1399-41E1-AE05-ED724962A0B5, OS:16.4, name:iPad Air (5th generation) }
{ platform:iOS Simulator, id:224291B0-1399-41E1-AE05-ED724962A0B5, OS:16.4, name:iPad Air (5th generation) }
{ platform:iOS Simulator, id:9878090D-1EF6-4864-AC10-1C07F231BC0D, OS:16.4, name:iPad Pro (11-inch) (4th generation) }
{ platform:iOS Simulator, id:9878090D-1EF6-4864-AC10-1C07F231BC0D, OS:16.4, name:iPad Pro (11-inch) (4th generation) }
{ platform:iOS Simulator, id:5BD02C56-30E5-4F7E-8CE7-271DD7D6ABC7, OS:16.4, name:iPad Pro (12.9-inch) (6th generation) }
{ platform:iOS Simulator, id:5BD02C56-30E5-4F7E-8CE7-271DD7D6ABC7, OS:16.4, name:iPad Pro (12.9-inch) (6th generation) }
{ platform:iOS Simulator, id:B80E7CE7-AE0A-4178-BBD8-10BC76FBEE33, OS:16.4, name:iPad mini (6th generation) }
{ platform:iOS Simulator, id:B80E7CE7-AE0A-4178-BBD8-10BC76FBEE33, OS:16.4, name:iPad mini (6th generation) }
{ platform:iOS Simulator, id:2BB942E1-CEEE-4AAA-B44A-9FCE7EFDBF28, OS:16.4, name:iPhone 14 }
{ platform:iOS Simulator, id:2BB942E1-CEEE-4AAA-B44A-9FCE7EFDBF28, OS:16.4, name:iPhone 14 }
{ platform:iOS Simulator, id:C213015F-D697-4D85-9B50-1109E2ABCADE, OS:16.4, name:iPhone 14 Plus }
{ platform:iOS Simulator, id:C213015F-D697-4D85-9B50-1109E2ABCADE, OS:16.4, name:iPhone 14 Plus }
{ platform:iOS Simulator, id:A3177264-6DCF-463A-931B-58042A0DCE90, OS:16.4, name:iPhone 14 Pro }
{ platform:iOS Simulator, id:A3177264-6DCF-463A-931B-58042A0DCE90, OS:16.4, name:iPhone 14 Pro }
{ platform:iOS Simulator, id:90595022-88AF-4077-9222-017F2F5B9C6E, OS:16.4, name:iPhone 14 Pro Max }
{ platform:iOS Simulator, id:90595022-88AF-4077-9222-017F2F5B9C6E, OS:16.4, name:iPhone 14 Pro Max }
{ platform:iOS Simulator, id:131B1694-5FA9-4CEF-9640-E23AF2E231FA, OS:16.4, name:iPhone SE (3rd generation) }
{ platform:iOS Simulator, id:131B1694-5FA9-4CEF-9640-E23AF2E231FA, OS:16.4, name:iPhone SE (3rd generation) }
** ARCHIVE FAILED **

错误分析:证书缺少Associated Domains capability。

解决办法(根据需求二选一即可):

    方式一、从新新增Associated Domains capability模块,生成新证书。

        1.1、登录苹果开发者官网。https://appstoreconnect.apple.com/

        1.2、【Certificates, Identifiers & Profiles】、【Identifiers】、选择对应APPID,点击进入。

        1.3、如图所示开启【Associated Domains】


        1.4、从新生产profile文件,进行云端打包。

    方式二、去掉Associated Domains capability相关配置。

        1.1、打开【manifest.json】文件源码视图。

        1.2、IOS配置去掉capabilities,如图:(注:capabilities整个配置都需要去掉,包含键名、键值)

"capabilities" : {
"entitlements" : {
"com.apple.developer.associated-domains" : [ "applinks:自定义域名" ]
}
},

        1.3、去掉UniversalLinks,注意包含UniversalLinks这个键名和键值都需要去掉。

        1.4、完成后,继续进行云打包即可。

注意项:

    若使用第二种方式,则需要充分考虑你的app中是否有使用该模块,如有使用则必须使用方式一解决。

六月初字帖坊小程序 你想要的字帖模板及工具,这里都有!