bytedance / Bytedance-UnionAD

MIT License
172 stars 53 forks source link

[BUG] Cocoapods warning when using the two different subspecs of the podspec #209

Closed x3mpablom closed 2 weeks ago

x3mpablom commented 3 months ago

Describe the bug | 问题描述

I am trying to AB test two different mediation services: AdMob and AppLovin. When including their Pangle adapters, I get the following warning after pod install:

[!] [Xcodeproj] Generated duplicate UUIDs:
...
...
...
PBXNativeTarget -- 19577840F1C48EB693BC2CD4B4C94D7E

Environmental information | 环境信息

To Reproduce | 如何复现

Include Ads-Global/BUAdSDK_Compatible and Ads-Global/BUAdSDK, either directly in the Podfile or via the AdMob and AppLovin adapters.

Additional context | 附言

This is happening because both the BUAdSDK_Compatible and BUAdSDK subspecs repeat resource definitions. A proposed solution would be to have a third subspec with the repeated lines, and have the other two depend on it:

  s.subspec 'BUAdSDK' do |ss|
    ss.dependency 'Ads-Global/Dep_Accurate'
    ss.dependency 'Ads-Global/BUAdSDK_Shared'
  end

  s.subspec 'BUAdSDK_Compatible' do |ss|
    ss.dependency 'Ads-Global/Dep_Compatible'
    ss.dependency 'Ads-Global/BUAdSDK_Shared'
  end

  s.subspec 'BUAdSDK_Shared' do |ss|
    ss.vendored_frameworks = ['SDK/PAGAdSDK.xcframework']
    ss.preserve_paths = 'SDK/PAGAdSDK.xcframework'
    ss.resource = 'SDK/PAGAdSDK.bundle'
    ss.resource_bundles = {
        'AdsGlobalSDK' => ['SDK/PAGAdSDK.xcframework/ios-arm64/PAGAdSDK.framework/PrivacyInfo.xcprivacy']
    }
  end
zhangbowen1234 commented 2 weeks ago

Just a warning for pod install, and v6.3.0.0 and above do not have this issue. You can upgrade and update the SDK.