Implicit declaration of function 'FBSDK_NOT_DESIGNATED_INITIALIZER' is invalid in C99 Expected ')'

此生再无相见时 提交于 2019-12-04 16:37:06

问题


I'm using Facebook SDK for iOS 4.6.0 and just today above error encountered after updating cocoapods to 0.38.2. I'm not sure this error has anything to do with cocoapods.

Error screenshot:


回答1:


I had the same issue. The problem appeared because, I was connecting both "ParseFacebookUtils" (which was loading "Facebook-iOS-SDK" (which is the deprecated version) and "FBSDKCoreKit" separately.

"Facebook-iOS-SDK" and "FBSDKCoreKit" both have "FBSDKMacros.h" which has different declarations of "FBSDK_NOT_DESIGNATED_INITIALIZER" and that is why message in XCode appear.

What I suggest, if "ParseFacebookUtils" is not in your podfile list, check which cocoaPod loading "Facebook-iOS-SDK" and try to update it with the newer version of that framework.

If "ParseFacebookUtils" is your case than easily change it to 'ParseFacebookUtilsV4'

And surely don't forget to run 'pod update' to make all changes active

Hope this helps.




回答2:


Delete FBSDKMacros.h from Facebook-iOS-SDK directory because whatever declared here is also declared in FBSDKMacros.h in FBSDKCoreKit directory and your code will be working fine.




回答3:


I removed the reference FBSDKMacros.h from the Facebook-iOS-SDK directory instead of deleting it. This did the trick for me.



来源:https://stackoverflow.com/questions/32877681/implicit-declaration-of-function-fbsdk-not-designated-initializer-is-invalid-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!