JeffB6688
JeffB6688

Reputation: 3880

'Unknown type name FBSDK_EXTERN' Build Error resulting from use of CocoaPods and use_frameworks

I am trying to upgrade my iOS app with the latest FacebookSDK. Facebook recommends the use of CocoaPods for upgrades. I was already using another 3rd party SDK that also uses CocoaPods. For the existing 3rd party SDK, it requires the use of use_frameworks! in the podFile. However, when I run 'pod update' and then build my app, I get the following errors:

Unknown type name FBSDK_EXTERN [facebook header file]

for each Facebook header file that uses this extern. How can I resolve this apparent incompatibility between podFile requirements of these two different SDKs?

My podFile looks like the following:

 platform :ios, '8.0'

 def shared_pod
   use_frameworks!

   pod 'apptentive-ios', '~> 4'
   pod 'FacebookSDK'

 end

 target 'myApp' do
   shared_pod
 end

 target 'myOtherApp' do
   shared_pod
 end

Alternatively, how can I resolve the 'Unknown type name FBSDK_EXTERN' to allow my app to build?

Upvotes: 3

Views: 1988

Answers (3)

Jan Erik Schlorf
Jan Erik Schlorf

Reputation: 2311

I tried Francisco's solution without success, downgraded to 4.37.0 and suddenly still got the same error (even though I had this version installed right before trying to update).

What then helped was simply cleaning Xcode's build folder, building now works for me.

Upvotes: 0

SiONYX
SiONYX

Reputation: 36

Had the same error when tried to compile FBSDKShareKit 4.38.1 with FacebookSDK 4.37.0. Updating FacebookSDK to 4.38.0 fixed this issue.

Upvotes: 1

Francisco Amado
Francisco Amado

Reputation: 80

I also had the same problem.

I believe this can be cause by CocoaPods cache.

The best approach (and worked for me) is

  • go to the /Pods folder
  • delete the problematic framework folder (may be named FBSDKLoginKit)
  • run pod install --repo-update again

if that doesn't work try resolving your pod to the previous version pod 'FacebookSDK', '4.37.0'

Cheers

Upvotes: 3

Related Questions