首页 > 解决方案 > 编译 xcode 和 FBSDK 时出错

问题描述

创建程序集时会产生错误。

如果通过 .cdworkspace

duplicate symbol _OBJC_IVAR_$_FBSDKDeviceLoginCodeInfo._verificationURL in:
    /Users/admin/Library/Developer/Xcode/DerivedData/Unity-iPhone-hiyuaervseeqdjddnyzvacrngstr/Build/Products/ReleaseForRunning-iphoneos/FBSDKLoginKit/libFBSDKLoginKit.a(FBSDKDeviceLoginCodeInfo.o)
    /Users/admin/Desktop/ios_idle/Frameworks/FacebookSDK/Plugins/iOS/FBSDKLoginKit.framework/FBSDKLoginKit(FBSDKDeviceLoginCodeInfo.o)
ld: 1197 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

如果通过 .xcodeproj

ld: warning: directory not found for option '-L/Users/admin/Library/Developer/Xcode/DerivedData/Unity-iPhone-aznohbyfwguqcwgiyilrfrsrcddz/Build/Products/ReleaseForRunning-iphoneos/FBSDKCoreKit'
ld: warning: directory not found for option '-L/Users/admin/Library/Developer/Xcode/DerivedData/Unity-iPhone-aznohbyfwguqcwgiyilrfrsrcddz/Build/Products/ReleaseForRunning-iphoneos/FBSDKLoginKit'
ld: warning: directory not found for option '-L/Users/admin/Library/Developer/Xcode/DerivedData/Unity-iPhone-aznohbyfwguqcwgiyilrfrsrcddz/Build/Products/ReleaseForRunning-iphoneos/FBSDKShareKit'
ld: library not found for -lBolts
clang: error: linker command failed with exit code 1 (use -v to see invocation)

如何修复它?

标签: xcodefacebookunity3d

解决方案


我删除了项目中 FacebookSDK 文件夹中的所有内容,但文件 FacebookSDK/SDK/Resources/FacebookSettings.xml 除外。我保存了这个文件,这样我以后就不必重新添加我的设置了。然后我重新导入了 Facebook SDK。

在最近的版本中,SDK 似乎发生了一些重大的层次结构变化。更新到较新版本之一时,它没有正确删除所有冗余文件,导致跨不同版本的类重复。


推荐阅读