ios - 使用 UnityFramework 时两次链接第三方静态库
问题描述
- 团结2019.4
- Cocoapods 1.10.1
- 代码 12.5
播客文件:
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
我试图解决这个问题:修改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已经链接了第三方静态库。如何防止Unity-iPhone链接第三方静态库。
我的英文不好,如果有描述不清楚,我会补充
解决方案
我也遇到了同样的问题。
- UnityFramework 是一个动态框架,如果在源代码中声明和使用,它必须链接依赖的 3Party 库。
- 您必须确保 Unity-iPhone 没有链接与 UnityFramework 相同的框架。
如果有其他解决方案,请通知我。
推荐阅读
- unity3d - 为 HoloLens 统一打开一些浏览器链接的按钮
- r - 如何用不同的过滤器()总结(n = n())?
- javascript - Promise 数据和异常处理
- java - 无法使用 Jdbctemplate 创建 XMLType 对象
- php - 为什么当我多次咨询服务器时它返回一个 405 错误 Laravel
- javascript - 如何使用橡木服务 CSS?
- python - 如何读取目录中文件的文件内容并将副本创建到新目录中?
- python - 以 .py 结尾的文件被视为 .txt 文件,而不是在 python 空闲时启动
- python - Darknet YoloV4 空预测
- flutter - Flutter InAppWebView 不允许文本字段中包含非英文内容