没有这样的模块 'FBSDKLoginKit' Xcode 9
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/47276076/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
No Such Module 'FBSDKLoginKit' Xcode 9
提问by Ryann786
Using CocoaPods, I have imported the below frameworks:
使用 CocoaPods,我导入了以下框架:
platform :ios, '11.0'
use frameworks!
target '{APP NAME}' do
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/AdMob'
pod 'Firebase/Messaging'
pod 'Batch'
pod 'FBSDKLoginKit'
pod 'FBSDKCoreKit'
pod 'Google-Mobile-Ads-SDK'
end
When I build my project, it runs happily on my iPhone with no errors.
当我构建我的项目时,它在我的 iPhone 上运行良好,没有错误。
When I try to create an Archive of the project, it shows one of the below and refuses to build the project to Archive.
当我尝试创建项目的存档时,它显示以下之一并拒绝将项目构建到存档。
No such module 'FBSDKCoreKit'
No such module 'FBSDKLoginKit'
I have no idea what I'm doing wrong as nothing has changed. I haven't archived in a few months and it's suddenly stopped working.
我不知道我做错了什么,因为什么都没有改变。我已经几个月没有存档了,它突然停止工作了。
I've removed and re-installed the Pods but nothing seems to fix the issue. Even if I remove one of the import statements the other FBSKD seems to fail.
我已经删除并重新安装了 Pod,但似乎没有任何解决问题的方法。即使我删除了其中一个导入语句,另一个 FBSKD 似乎也失败了。
采纳答案by I Jawaher
Try this!
尝试这个!
pod 'FBSDKCoreKit', '~> 4.10.0'
pod 'FBSDKLoginKit', '~> 4.10.0'
pod 'FBSDKShareKit', '~> 4.10.0'
回答by Hwangho Kim
Please add
请加
pod 'FBSDKCoreKit'
also.
还。
回答by Uma Madhavi
Try to update your pod file like this
尝试像这样更新您的 pod 文件
pod 'FacebookCore'
pod 'FacebookLogin'
回答by bigkurtdirt49
Not sure if you already found an answer but this worked for me, I had the same problem as you, kind of weird but it worked.
不确定你是否已经找到了答案,但这对我有用,我和你有同样的问题,有点奇怪,但它有效。
I uninstalled the pods 'FBSDKCoreKit', 'FBSDKShareKit', and 'FBSDKLoginKit'
我卸载了“FBSDKCoreKit”、“FBSDKShareKit”和“FBSDKLoginKit”
I then installed pods 'FacebookCore' and 'FacebookLogin' this also installs the previous pods I uninstalled.
然后我安装了 pod 'FacebookCore' 和 'FacebookLogin' 这也安装了我之前卸载的 pod。
When I typed import FBSDKCoreKit in my AppDelegate header I still received an error.
当我在 AppDelegate 标头中输入 import FBSDKCoreKit 时,我仍然收到一个错误。
So just for shits and gigs I removed import FBSDKCoreKit and replaced it with import FacebookLogin and there were no errors
所以只是为了狗屎和演出,我删除了 import FBSDKCoreKit 并将其替换为 import FacebookLogin 并且没有错误
I then typed in the necessary code in my AppDelegate file stated in the instructions of Step 5: Connect to AppDelegate (https://developers.facebook.com/docs/ios/getting-started)
然后,我在步骤 5:连接到 AppDelegate ( https://developers.facebook.com/docs/ios/getting-started) 的说明中所述的 AppDelegate 文件中输入了必要的代码
I ran the app, the build failed but I went into my AppDelegate file and again, for shits and gigs, typed in import FBSDKCoreKit in the header (without removing import FacebookCore) and there were no errors. Then I removed import FacebookCore from the header and still no errors.
我运行了应用程序,构建失败了,但我进入了我的 AppDelegate 文件,并再次进入了我的 AppDelegate 文件,并在标题中输入了 import FBSDKCoreKit(没有删除 import FacebookCore),并且没有错误。然后我从标题中删除了 import FacebookCore 并且仍然没有错误。
still messing with the syntax to get "Build Successful" but it seems to be heading in the right direction.
仍然弄乱语法以获得“构建成功”,但它似乎正朝着正确的方向前进。
I'm new to xCode and Swift, so honestly I'm not exactly sure what I did that was the main reason for the fix but this worked for me. Let me know if this helped!
我是 xCode 和 Swift 的新手,所以老实说,我不确定我做了什么,这是修复的主要原因,但这对我有用。如果这有帮助,请告诉我!
回答by Ash
The actual issue is there is a bug with Xcode wherein its not recognizing the pods already installed and added to the project.Thats why the module not found error during compile time. I am getting the same build error with many other pods afterwards also.Its happening only at times that too unexpectedly .The only way is to build the project multiple times until it recognizes the module and the error is gone .This sounds crazy but no other way so far. Also, Use cmd+B to build your code. Hope this helps.
实际问题是 Xcode 存在一个错误,其中它无法识别已安装并添加到项目中的 pod。这就是为什么在编译时未发现模块错误的原因。之后我也遇到了与许多其他 pod 相同的构建错误。它只在出乎意料的时候发生。唯一的方法是多次构建项目,直到它识别出模块并且错误消失了。这听起来很疯狂,但没有其他方法到目前为止。此外,使用 cmd+B 构建您的代码。希望这可以帮助。
回答by Nick Podratz
This error appeared for me when I added a new build-target to my project.
Xcode added this change which caused all the trouble.
当我向我的项目添加一个新的构建目标时,这个错误出现在我身上。
Xcode 添加了导致所有麻烦的更改。
- E31B6D4E3385CBFF63FDF655 /* BuildFile in Frameworks */,
+ E31B6D4E3385CBFF63FDF655 /* (null) in Frameworks */,
When I removed the change from my commit history, all worked fine.
I did so with an interactive rebase.
当我从提交历史中删除更改时,一切正常。
我是通过交互式 rebase 来实现的。
回答by Tanjima Kothiya
Try this!!
尝试这个!!
Goto General -> Linked Frameworks and Libraries -> remove Framework.
转到常规 -> 链接的框架和库 -> 删除框架。