jeduan / cordova-plugin-facebook4

Use the latest Facebook SDK in your Cordova and Ionic projects
Other
767 stars 511 forks source link

'FBSDKCoreKit/FBSDKCoreKit.h' file not found #847

Closed Buraky89 closed 3 years ago

Buraky89 commented 4 years ago

Hello, I am getting an error such as "'FBSDKCoreKit/FBSDKCoreKit.h' file not found" when I do the following

$ cordova create myApp Creating a new cordova project. $ cd myApp/ $ cordova platform add ios Using cordova-fetch for cordova-ios@~4.5.4 Adding ios project... Creating Cordova project for the iOS platform: Path: platforms/ios Package: io.cordova.hellocordova Name: HelloCordova iOS project created with cordova-ios@4.5.5 Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project Installing "cordova-plugin-whitelist" for ios Adding cordova-plugin-whitelist to package.json Saved plugin info for "cordova-plugin-whitelist" to config.xml --save flag or autosave detected Saving ios@~4.5.5 into config.xml file ... $ cordova plugin add cordova-plugin-facebook4 --save --variable APP_ID="123456789" --variable APP_NAME="myApplication" Installing "cordova-plugin-facebook4" for ios Adding cordova-plugin-facebook4 to package.json Saved plugin info for "cordova-plugin-facebook4" to config.xml

Then I try to build it in XCode Version 11.1 (11A1027), I get the following error:

'FBSDKCoreKit/FBSDKCoreKit.h' file not found

I am using cordova-ios 4.5.5.

I tried adding the following lines (as you can see in the second commit, in my reproduce repository)

Then removed and readded the ios platform.

Then another error shows up: Module 'FBSDKCoreKit' not found FBSDKLoginButton.h

Expected Behavior

Project is able to be built

Plugin version, OS, devices, etc

Cordova version: 8.1.2 (cordova-lib@8.1.1) Cordova-ios version: 4.5.5 XCode version: 11.1 (11A1027)

Sample repo

https://github.com/Buraky89/CordovaFacebookReprod

peterpeterparker commented 4 years ago

See doc https://github.com/jeduan/cordova-plugin-facebook4/blob/master/docs/ios/README.md

Buraky89 commented 4 years ago

See doc https://github.com/jeduan/cordova-plugin-facebook4/blob/master/docs/ios/README.md

I tried what is on the doc, as you can see in the reproduction repo.

peterpeterparker commented 4 years ago

In that case please use another channel as it is a support request, thx in advance.

Buraky89 commented 4 years ago

So what should I do for it to not be a support request? Do all XCode's and all cordova-ios versions have to face this issue, in order for this to be an issue?

peterpeterparker commented 4 years ago

Which command should I run with your repo to reproduce the problem?

Buraky89 commented 4 years ago

Opening HelloCordova.xcworkspace with XCode 11.1 and trying to build will reproduce the problem

peterpeterparker commented 4 years ago

Couldn't build neither with XCode.

Still a support request to me regarding Pod and compatibility with iOS@4.5.5.

I reopen the task, you are most welcomed to close it when you'll find the solution and if you could provide afterwards a PR to improve the doc that would be great.

peterpeterparker commented 4 years ago

Linked with #811, #812 or others https://github.com/jeduan/cordova-plugin-facebook4/issues?utf8=✓&q=FBSDKCoreKit.h

jvkxhola commented 4 years ago

I was having the same problem and maybe i found a way to fix it.

As it was mentioned in #811, the problem was missing Facebook SDKs, which should be specified in PodFile

Switching those lines in the config.xml of this plugin:

       <podspec>
            <config>
                <source url="https://github.com/CocoaPods/Specs.git"/>
            </config>
            <pods use-frameworks="true">
                <pod name="FBSDKCoreKit" spec="5.7.0"/>
                <pod name="FBSDKLoginKit" spec="5.7.0"/>
                <pod name="FBSDKShareKit" spec="5.7.0"/>
            </pods>
        </podspec>

fot that:

        <framework src="FBSDKCoreKit" type="podspec" spec="5.7.0" />
        <framework src="FBSDKLoginKit" type="podspec" spec="5.7.0" />
        <framework src="FBSDKShareKit" type="podspec" spec="5.7.0" />

makes the SDKs appear in the PodFile, as it should.

simetin commented 4 years ago

Hi ! I'm facing the same issue with Cordova iOS 5.1.1. Tried pretty much everything mentioned in the docs and the threads that I found. Anyone know a fix for this version of Cordova ?

I forgot that I downgraded Cordova to 8.0.0 a couple of days ago 😅

giuseeFG commented 4 years ago

it works using these PODs:

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

and use version="6.3.0" of facebook4 plugin

cheers

Senglean commented 4 years ago

we are stuck and can't release new update for our game 😭

cant get past 'FBSDKCoreKit/FBSDKCoreKit.h' file not found

adding the plugin comes with a sudo error (trying to do pods stuff) after which i run various pods commands in platforms/ios ...resolve run paths etc any help will be appreciated

Senglean commented 4 years ago

Yey i managed to build with xcode

My problem was coming from the fact I have to use sudo to install the plugin.

daveshirman commented 4 years ago

I went round in circles on this, only to end up actually reading the readme file here:

If building your project in Xcode, you need to open YourProject.xcworkspace (not YourProject.xcodeproj) so both your Cordova app project and the Pods project will be loaded into Xcode.

So yeah, I did that, then selected the project in the left hand pane and it built as normal.

Hope this helps.

tarun57 commented 4 years ago

Hi @peterpeterparker I used this code but it can't solve my problem. Can you please help me more?

arielhasidim commented 4 years ago

if nothing helps, consider this (i struggled with this for weeks): https://github.com/jeduan/cordova-plugin-facebook4/issues/795#issuecomment-568289028

JayzeeHuang commented 4 years ago

Have you try ios 5? I used to get this error, but it gone now

romonsalve commented 4 years ago

In my case update cordova to 9 fix the problem using 6.4.0, If the pods are installed when you add the plugin, the build will success

noahcooper commented 3 years ago

This plugin is deprecated. Check out cordova-plugin-facebook-connect at https://www.npmjs.com/package/cordova-plugin-facebook-connect. The plugin uses v8 of the Facebook SDK from Cocoapods, and the build succeeds without this error.