使用UnityFramework时两次链接第三方静态库

Linked the third-party static library twice when use UnityFramework

播客文件:

source 'https://cdn.cocoapods.org/'
use_frameworks!

platform :ios, '10.0'

target 'UnityFramework' do
  pod 'AppsFlyerFramework', '~> 6.2.4'
end

target 'Unity-iPhone' do
end

运行日志

objc[5990]: Class AppsFlyerProxyManager is implemented in both /private/var/containers/Bundle/Application/97237BCE-C78A-4C22-8DE2-19D7CC866571/dev.app/dev (0x102d6b4c0) and /private/var/containers/Bundle/Application/97237BCE-C78A-4C22-8DE2-19D7CC866571/dev.app/Frameworks/UnityFramework.framework/UnityFramework (0x10c670350). One of the two will be used. Which one is undefined.
objc[5990]: Class AppsFlyerCrossPromotionHelper is implemented in both /private/var/containers/Bundle/Application/97237BCE-C78A-4C22-8DE2-19D7CC866571/dev.app/dev (0x102d6b510) and /private/var/containers/Bundle/Application/97237BCE-C78A-4C22-8DE2-19D7CC866571/dev.app/Frameworks/UnityFramework.framework/UnityFramework (0x10c6703a0). One of the two will be used. Which one is undefined.

AppsFlyerFramework 是静态库

$ file Versions/A/AppsFlyerLib
Versions/A/AppsFlyerLib: Mach-O universal binary with 4 architectures: [i386:current ar archive] [arm_v7] [x86_64] [arm64]
Versions/A/AppsFlyerLib (for architecture i386):    current ar archive
Versions/A/AppsFlyerLib (for architecture armv7):   current ar archive
Versions/A/AppsFlyerLib (for architecture x86_64):  current ar archive
Versions/A/AppsFlyerLib (for architecture arm64):   current ar archive

我试图解决这个 problem:modify Podfile 如下:

source 'https://cdn.cocoapods.org/'
use_frameworks!

platform :ios, '10.0'

target 'UnityFramework' do
  pod 'AppsFlyerFramework', '~> 6.2.4'
end

target 'Unity-iPhone' do
end

static_frameworks = ['AppsFlyerFramework']
# make all the static frameworks into static frameworks by overriding the static_framework? function to return true
pre_install do |installer|
  installer.pod_targets.each do |pod|
    puts pod.name
    if static_frameworks.include?(pod.name)
      puts "Overriding the static_framework? method for #{pod.name}"
      def pod.static_framework?;
        true
      end
    end
  end
end

但是并没有解决问题

UnityFramework是动态库。Unity-iPhone依赖UnityFramework。 UnityFramework依赖第三方框架

UnityFramework 已经 link 编辑了第三方静态库 library.How 以防止 Unity-iPhone 到 link 第三方静态库。

我的英文不好,如果有描述不清楚的,我会补充

我也遇到了同样的问题

  1. UnityFramework 是一个动态框架,如果您在源代码中声明和使用它们,它必须 link 依赖 3Party 库。
  2. 您必须确保 Unity-iPhone 没有 link 与 UnityFramework 相同的框架。

如果有其他解决方案,请告诉我。