Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
JonathanVeg opened this issue May 13, 2022 · 21 comments
Closed

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

JonathanVeg opened this issue May 13, 2022 · 21 comments

Comments

@JonathanVeg
Copy link

I'm receiving the error 'FBSDKCoreKit/FBSDKCoreKit.h' file not found always when trying to run the app on my iPhone from xCode.

But when I run it from terminal, with the react-native run-ios it's working normally, as expected.

I already tried to update podfile, rerun it and a lot of other things and nothing solved the problem.

I must run this on device for testing in app purchase in another part of the app.

The import seems to be correct but does not work.

Captura de Tela 2022-05-13 às 10 48 29

The podfile.

Captura de Tela 2022-05-13 às 10 48 45

The most weird part is that it's always working in the simulator with no problem.

@mikehardy
Copy link
Collaborator

Interesting, not sure there will be any real solution from others (including me) on this, it sounds like some sort of local config issue.
Specifically, if you run the example from here and it works, then it's a local problem - we can't help but then you at least know that you've got a project issue, not a problem here with the module.

Have you tried npx react-native-clean-project ? Other than that, unsure, sorry

@JonathanVeg
Copy link
Author

Interesting, not sure there will be any real solution from others (including me) on this, it sounds like some sort of local config issue. Specifically, if you run the example from here and it works, then it's a local problem - we can't help but then you at least know that you've got a project issue, not a problem here with the module.

Have you tried npx react-native-clean-project ? Other than that, unsure, sorry

Thanks for answering, but I tried and nothing. It's weird, do not make sense to me. And I'm stuck in this error blocking me for testing the payment system...

@mikehardy
Copy link
Collaborator

Hmm - it would help if you specify what you tried, I had multiple suggestions?

@JonathanVeg
Copy link
Author

I tried lot of things. Your suggestion, some from stackoverflow (like removing the from xcode settings and adding pod manually, removing pods and node_modules, etc.), updating libs, etc.

Everything I know is possible.

@mikehardy
Copy link
Collaborator

Thanks! I mentioned this:

if you run the example from here and it works, then it's a local problem - we can't help but then you at least know that you've got a project issue, not a problem here with the module.

I guess I'm curious if the example fails in your environment as well. If it fails you have an environment problem (toolchain versions or something), since it is known working in scripted / reproducible environments (like CI). If it works, then you have a project problem. Might help you narrow the problem down some

@JonathanVeg
Copy link
Author

Thanks! I mentioned this:

if you run the example from here and it works, then it's a local problem - we can't help but then you at least know that you've got a project issue, not a problem here with the module.

I guess I'm curious if the example fails in your environment as well. If it fails you have an environment problem (toolchain versions or something), since it is known working in scripted / reproducible environments (like CI). If it works, then you have a project problem. Might help you narrow the problem down some

Got it, the point of the lib itself.

I had to install the lib in swift packages, point that I already tried before with no success. This time, after some updates I was able to install it.

The point one of Getting Started Guide for Facebook SDK for iOS. That in theory I do not need to do (in the guide here is specified to follow from step 2).

Now I'm running other error "The code signature version is no longer supported.", but it does not have relation with this issue that I opened.

@mikehardy
Copy link
Collaborator

Hmm - that's definitely not a recommended course. I can see how that could work (hey! there's definitely a dependency now), but the react-native ecosystem is built on cocoapods, and not the swift package manager. Having two dependency managers trying to do the same dependency at once seems like a bad idea.

I'd investigate why the cocoapods dependency was not working correctly, personally. You'll notice that our example does not just work correctly, it is actually built with a script you may inspect, in order to see all that is necessary to run the module: https://github.com/thebergamo/react-native-fbsdk-next/blob/master/refresh-example.sh

@Brqqq
Copy link

Brqqq commented May 18, 2022

I have the same error, except it builds and runs fine in xcode on the dev machine but fails in our build server (Azure DevOps) using Fastlane. I had just upgraded from the deprecated react-native-fbsdk to this react-native-fbsdk-next. I'll also investigate and report back

@JonathanVeg
Copy link
Author

Got it, I do not know why. But I just got to another branch (old one) and restart the process of changing the old lib to the '-next' one.

It worked properly in the simulator and in the device. In the first try!

But when I try to update it to appstore, using the "Product -> Archive" I'm just getting a new error. One hard to understand too.

Definitively it's not easy, but I think it should be.

Captura de Tela 2022-05-18 às 15 38 38

@mikehardy
Copy link
Collaborator

Looks like a code signing issue inside a framework inside cocoapods. Those are strange.
I've seen something similar with macCatalyst builds (which must be signed even for local development), and resource bundles missing signatures. If I understand correctly, internal frameworks can have an anonymous signature, so I work around it like this in a post-install block in my Podfile

the "-" is anonymous, not sure if this one will select for the right thing that needs signing, but you might play around with it. I can guarantee it works for macCatalyst builds signing resource bundles in frameworks in cocoapods dependencies at least, and this seems similar

    installer.pods_project.targets.each do |target|
      if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
        target.build_configurations.each do |config|
          config.build_settings["CODE_SIGN_IDENTITY[sdk=macosx*]"] = "-"
        end
      end
    end

@Brqqq
Copy link

Brqqq commented May 19, 2022

For me, the header file not found issue was caused by the iOS deployment target being 10.0 instead of 11.0 (RN 0.67.4)

@JonathanVeg
Copy link
Author

The header file problem was magically solved (i really do not know how...).

But the sign problem is hard to understand. I think it's related to some SH file inside the FB libs that i noticed that is not inside others frameworks added. I have no idea about how to take it off.

@JonathanVeg
Copy link
Author

I will close this issue and opened another because the current discussion is already another and not the original one from the issue.

And thanks, @mikehardy, for trying to help me! Really appreciate it.

@minhchienwikipedia
Copy link

I got the same issue, do we have any specific way to resolve it?

@mikehardy
Copy link
Collaborator

There are a few mentioned above, how did it go when you tried them?
You'll also note that you can just run refresh-example.sh from this repo and it builds a working integrated app.

I don't reproduce a problem so I can't fix a problem 🤷

@minhchienwikipedia
Copy link

minhchienwikipedia commented Jun 4, 2022

@mikehardy I just upgrade from version 4.4.1 to 8.0.5 and then I'm getting this issue, but not exactly look like that, it looks like this (the image). I had tried to remove package-lock.json, Podfile.lock, Pods folder, and reinstall everything but no luck for me. Did I miss something when I upgrade it?
image


And one more strange thing when I'm trying to install pod it looks like this, it should be install FBSDKCoreKit 13.2.0 but it reinstall FBSDKCoreKit 9.3.0 I have no idea about it
image

@mikehardy
Copy link
Collaborator

Why you are using version 9.3.0 of the pod is beyond me. You should check in to that.
We define in our podspec a dependency on 13.2

@minhchienwikipedia
Copy link

minhchienwikipedia commented Jun 5, 2022

@mikehardy That's why I want to ask, the old version (react-native-fbsdk-next: 4.4.1) uses 9.3.0 and I'm trying to upgrade to react-native-fbsdk-next: 8.0.5, I just run pod install and then I'm getting this issue, the old version 9.3.0 still reinstall, it should be overridden!?
Even though I remove the package and reinstall the new one, it still install version 9.3.0
image
And I just check the Podfile.lock, seems the podsec update not update the FBSDKCoreKit/Basics version!?
image

@mikehardy
Copy link
Collaborator

You must have something else bringing that pod in. Either something in your podfile or some other pod. This is project specific and not within our modules control.

@minhchienwikipedia
Copy link

@mikehardy I found it, seems FBAudienceNetwork required FBSDKCoreKit/Basics. Not related react-native-fbsdk-next. Thanks for your support!
image

@JonathanVeg
Copy link
Author

I solved my problem by adjusting the version of the lib.

I was using the wrong version of this, it has to be in a specific version related to my RN version.

I also noticed that even updating this I was getting this error when open the project and not the wokspace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants