1. 依赖项(Podfile)
1.1 为什么仍然需要 Podfile
AKSKit.xcframework/AppsKit.xcframework 直接以二进制框架的形式链接(§2),而不是通过 pod 集成。但 AppsKit.xcframework 编译后的 Swift 模块引用了多个第三方 SDK(Firebase、Google Mobile Ads、IronSource、Adjust、AppsFlyer、AppLovin)中的符号。即使你从未直接调用其中大多数 SDK,也必须通过 CocoaPods 将它们加入依赖图,否则构建时会出现链接失败。
1.2 必需的 pod(始终需要)
source 'https://cdn.cocoapods.org'
platform :ios, '15.0'
target 'YourApp' do
use_frameworks!
# Remote Config drives almost all AKS behavior; Analytics/Crashlytics back AKS events and crash reporting
pod 'Firebase/Analytics', '~> 12.15.0'
pod 'Firebase/Crashlytics', '~> 12.15.0'
pod 'Firebase/RemoteConfig', '~> 12.15.0'
pod 'Google-Mobile-Ads-SDK'
# Required by AppsKit.xcframework's compiled swiftinterface — these are transitive
# dependencies of the AKS facade itself, not direct calls you make.
pod 'IronSourceSDK', '~> 9.1.0.0'
pod 'Adjust', '~> 5.4.6'
pod 'AppsFlyerFramework'
pod 'AppsFlyer-AdRevenue'
pod 'AppLovinSDK'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'
config.build_settings['DEBUG_INFORMATION_FORMAT'] = 'dwarf-with-dsym'
end
end
end上述版本来自一个已验证可正常运行的参考集成,其当前解析结果记录在 Podfile.lock 中:Firebase/* 12.15.0、未锁定版本以跟进最新版的 Google-Mobile-Ads-SDK(会通过传递依赖引入 GoogleUserMessagingPlatform)、IronSourceSDK 9.1.0.0、Adjust 5.4.6、AppsFlyerFramework/AppsFlyer-AdRevenue 6.14.3、AppLovinSDK 13.5.0。请将这些版本视为已验证可用的基线,而不是必须严格锁定的版本。你可以根据应用需求升级,但请将 IPHONEOS_DEPLOYMENT_TARGET 保持为 15.0 或更高,以满足 AppsKit.xcframework/AKSKit.xcframework 构建时所使用的最低部署版本要求。
post_install中的DEBUG_INFORMATION_FORMAT = 'dwarf-with-dsym'并非可有可无的配置:缺少这一行时,部分 pod(尤其是 AppLovinSDK)不会生成 dSYM 文件,导致崩溃日志无法符号化,还可能在上传时无法通过 App Store Connect 的 dSYM 校验。
1.3 MMP SDK
Solar Engine 不需要通过 pod 添加——它已经编译进 AKSKit.xcframework,因此你不会在 Podfile 中看到它,也无需添加。相比之下,AppsFlyer 和 Adjust 确实需要由接入方通过 pod 集成(见上文 §1.2),因为 AppsKit.xcframework 的 Swift 代码会直接调用它们实际的 SDK 方法(IOSBridgeImp.swift 中的 initializeAppsFlyer/initializeAdjust)。
1.4 广告网络 / 广告聚合 SDK
参考 Podfile 仅添加了 Google-Mobile-Ads-SDK、IronSourceSDK 和 AppLovinSDK,没有单独添加“AdMob 聚合适配器”pod。如果你的 AKS 门户配置启用了通过 AdMob 对未列出的广告网络进行竞价或瀑布流聚合,请确认该广告网络是否需要专用的 CocoaPods 适配器(例如 GoogleMobileAdsMediation* pod)。本指南仅涵盖已在参考应用中验证可正常运行的配置。