需要 4.0.0 或更高版本,但 FBSDKCoreKit 提供 1.0.0 版本

requires version 4.0.0 or later, but FBSDKCoreKit provides version 1.0.0

我使用的是 FBSDK cocoapod,应用程序 运行 非常好,我没有对应用程序或 xcode 设置进行任何更改,因为它正在运行,现在我 运行 在物理设备上我收到以下错误:

错误:

dyld: Library not loaded: @rpath/FBSDKCoreKit.framework/FBSDKCoreKit Referenced from: /private/var/mobile/Containers/Bundle/Application/FC27A115-3A03-462B-9980-1189DB1E6578/< app_name >.app/< app_name > Reason: Incompatible library version: < app_name > requires version 4.0.0 or later, but FBSDKCoreKit provides version 1.0.0 (lldb)

但是我的 pod 文件使用的是 FBSDK 4.4

广告连播:

pod 'FBSDKCoreKit', '~> 4.4'
pod 'FBSDKLoginKit', '~> 4.4'
pod 'FBSDKShareKit', '~> 4.4'

有人知道这里发生了什么吗?我尝试了新的 pod 安装删除 pods 并重新安装,它似乎可以构建到模拟器

将这个脚本添加到我的 podfile 然后 运行 pod install 为我解决了这个问题

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['DYLIB_COMPATIBILITY_VERSION'] = ''
        end
    end
end

希望这对其他人有帮助,我仍然对任何其他解决方案感兴趣。