facebookarchive / react-native-fbsdk

A React Native wrapper around the Facebook SDKs for Android and iOS. Provides access to Facebook login, sharing, graph requests, app events etc.
https://developers.facebook.com/docs/react-native
Other
2.99k stars 909 forks source link

FBSDKCoreKit/FBSDKCoreKit.modulemap' not found #780

Open sudeepjainn opened 3 years ago

sudeepjainn commented 3 years ago

FBSDKCoreKit.modulemap' not found

I am creating a IOS build but i am getting an error:fatal error: module map file '/Users/pmarshall/Library/Developer/Xcode/DerivedData/tvderby_app-ctaepyojeedweaeatsjuuzaicdaj/Build/Products/Debug-iphonesimulator/FBSDKCoreKit/FBSDKCoreKit.modulemap' not found

1 error generated.

I updated POD and Imported

ifdef BUCK

import <FBSDKCoreKit/FBSDKCoreKit.h>

else

u/import FBSDKCoreKit;

endif

but still getting same error. Anyone have any solution for this.how can I solve this issue????

belgamo commented 3 years ago

I have the same issue but it works on the simulator. I'm using xcode 11.5. Any solution?

vlanemcev commented 3 years ago

same problem (((

vlanemcev commented 3 years ago

@sudeepjainn do you resolve this issues?

winstromming commented 3 years ago

I was able to solve by doing imports in my AppDelegate.m file:

#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
#import <FBSDKShareKit/FBSDKShareKit.h>

Podfile has these lines:

  pod 'FBSDKCoreKit', :modular_headers => true
  pod 'FBSDKLoginKit', :modular_headers => true
  pod 'FBSDKShareKit', :modular_headers => true

Which then threw up some Swift errors, which I solved by following these instructions: https://github.com/mxcl/PromiseKit/issues/1059#issuecomment-493925940

cefalo-chanchal commented 3 years ago

I am getting the same error. using Xcode 11.6 (11E708), react-native 0.63.0 and react-native-fbsdk 2.0.0

cefalo-chanchal commented 3 years ago

@vassilmladenov @belgamo By any chance you opened on Xcode .xcodeproj file instead of .xcworkspace file?

oularrea commented 3 years ago

Any solutions for this issue?

BogdanRad commented 3 years ago

@oularrea do you resolve this problem?

BogdanRad commented 3 years ago

Hey @janicduplessis, do you know how can i fix this problem ? :( on emulator is ok, the problem is when i try to run from xCode on release image

oularrea commented 3 years ago

Yes, in my case I get the error when I update the ios sdk to 11.0 and just when I compiled to release, but in the end I solved in the xcode putting the target to 11 as before I had it in 9.0

joaom182 commented 3 years ago

Same issue here.

Steps to reproduce:

npx react-native init fbsdkexample
cd fbsdkexample
yarn add react-native-fbsdk
cd ios && pod install && cd ../
npx react-native run-ios
joaom182 commented 3 years ago

@sudeepjainn have you tried to build your project with XCode instead of react-native-cli?

davichoso commented 3 years ago

same issue with xcode Version 12.0

davichoso commented 3 years ago

I had to downgrade xcode to make it work with xcode Version 11.7 (11E801a) the problem for me was xcode 12 I think is a problem related to cocoapods https://developer.apple.com/forums/thread/660864

diogoaltoe commented 3 years ago

Same issue here. I tried everything that was mentioned above, including the suggestions on this thread (https://github.com/facebook/react-native/issues/28503), but so far without success ... I am 4 days trying to solve this problem and nothing yet.

I'm using: Xcode 11.7 and React Native: 0.63.2.

diogoaltoe commented 3 years ago

I build the app.

I don't know exactly which change is responsible for making it work, but I will list what I did.

1) I removed Xcode 12 completely, according to this thread: https://stackoverflow.com/questions/31011062/how-to-completely-uninstall-xcode-and-clear-all-settings (I used the second answer). 2) And I installed Xcode 11.7. 3) In Xcode, I went to File > Workspace Settings, and change Build System to Legacy Build System (in both option, "Shared Workspace Settings" and "Per-User Workspace Settings"). 4) So I received a different error and resolved it according to this thread: https://stackoverflow.com/questions/55361057/this-copy-of-libswiftcore-dylib-requires-an-os-version-prior-to-12-2-0

PS.: Remember when your project builds, go to "Show the Issue navigator" and click on the Warning that says something like: "change/migrate to Swift 5".

Now I am trying to solve some errors when the application loads in the simulator. I am getting the following error in React Native: "Unhandled JS Exception: Invariant Violation: Native module cannot be null."

The saga continues ...

benoitvallon commented 3 years ago

I went through many Xcode upgrades (12.2 Beta) and downgrades (11.7) for half a day and then I restarted my computer for a completely different reason and it worked (with Xcode 12)... Hope it can help some of you

zxcpoiu commented 3 years ago

I'm trying to build on RN 63.3 + xcode 12 and encounter the same issue. ( Debug-IPhone/FBSDKCoreKit/FBSDKCoreKit.modulemap' not found )

To me, I believe it's an xcode 12 issue. I could successfully build from xcode directly, but have this issue if I use xcodebuild or react-native run-iosfrom terminal command line.

My whole process to make it work are like below:

  1. follow https://github.com/facebook/react-native/issues/29984, which redirect to a link: https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-object-file-built-for-ios to exclude arm64 arch. I just add the simple one like this: https://stackoverflow.com/a/63622570/5436231 rather than the accepted answer.

  2. Since I just upgraded to xcode 12, so make sure system using correct executable. on terminal sudo xcode-select --switch /Applications/Xcode.app ( from: https://github.com/facebook/react-native/issues/28503#issuecomment-612662198 )

  3. clear all installed pods. rm -rf ios/Pods, rm ios/Podfile.lock

  4. make sure you have matching deployment ios target both in xcode and Podfile, like 9.0 or 10.0 or 11.0, but should match. I personally using 10.0.

  5. close everything and restart/reboot mac, to make sure system does not have any cache issue.

  6. after reboot, cd ios; pod repo update; pod install;

Then the xcodebuildworked. ( I'm not using lagacy build system, I'm using the default modern build system both for xcode and xcodebuild )

hope it helps someone.

cylim commented 3 years ago

I was having the same issues with Xcode 12.

I got lucky by upgrade my .xcodeproj with the warning update to recommended settings, then it works.

pierre-fribourg-context commented 3 years ago

@sudeepjainn have you tried to build your project with XCode instead of react-native-cli?

I did this, and I have this issue also now

owenr88 commented 3 years ago

I managed to solve this issue in the end (RN 0.63.3) by including the below in the Podfile and installing. I'm sure there's a better way to do it (like this by @winstromming), but it worked for now!

  pod 'FBSDKCoreKit', :git => 'https://github.com/facebook/facebook-ios-sdk.git', :tag => 'v7.1.1'
  pod 'FBSDKLoginKit', :git => 'https://github.com/facebook/facebook-ios-sdk.git', :tag => 'v7.1.1'
  pod 'FBSDKShareKit', :git => 'https://github.com/facebook/facebook-ios-sdk.git', :tag => 'v7.1.1'

And then changing the location to 'Relative to Workspace' in Xcode as below. This included the .modulemap file as needed when archiving.

Screenshot 2020-10-12 at 13 35 12

ahtisham09 commented 3 years ago

I tried all solution but still same error

My Environment Xcode 12 react native 0.63 fbsdk 2.0.0

nahuelb commented 3 years ago

Similar to @oularrea, recently upgraded the IOS deployment target to 11.0 and started getting this error, I realized I forgot to change the IOS target also on the Project Deployment Target, that solved the issue.

Screen Shot 2020-10-20 at 23 10 42

Check that you have the same IOS target on the Podfile, Target and Project.

Before realizing I had that target mismatch I tried downgrading the npm package from 2.0.0 to 1.1.2, that also fixed the issue. yarn add react-native-fbsdk@1.1.2 & rm -rf ios/Pods & cd ios & pod install

duspada commented 3 years ago

didn't make it work here... tried every solutions here...

arjunkomath commented 3 years ago

Adding arm64 to excluded architectures (for both project and Pods build settings) fixed the issue for me.

Screen Shot 2020-11-21 at 10 01 04 pm
sanguineman91 commented 3 years ago

Please someone solve this problem thanks very much

samparmenter commented 3 years ago

Fixed using @nahuelb suggestion above. Any deployment target under 11 was failing but 11 fixed the issue for me and allowed me to archive for a release.

aryanagarwal15 commented 3 years ago

Stuck on this as well. Requesting maintainers to address this issue.

shawwal commented 3 years ago

I also having same issues and try every single solution here with no result, I'm using macOS Big Sur version 11.0.1 and Xcode version 12.2 (12B45b).

DrSwad commented 3 years ago

@vassilmladenov @belgamo By any chance you opened on Xcode .xcodeproj file instead of .xcworkspace file?

Thanks! I never built a native iOS app before. Both of these files opened up the project in XCode, so didn't realise this could be the issue. Running the build command from .xcworkspace solved it for me.

Fortidude commented 3 years ago

I have the same issue with bigsur and Xcode 12.3, but ONLY in cli.

building with Xcode works perfectly. CLI Xcode version the same, 12.3.

Not sure yet why is that.

ipuris commented 3 years ago

I had the same issue with BigSur and Xcode 12.3 after I updated in Podfile to platform :ios, '11.0', and I solved the issue finally. I tried many approaches so I'm not sure, but I think below three things are the key.

image image image

In my case, I changed the first and second settings above right after I had changed Podfile and had gotten the error, but I missed the third settings (= Targets setting). I hope my experience helps other developers.

dsouksavatd commented 3 years ago

I faced the same issue on build release, please make sure your platform ios version is the same with xcode project

Screen Shot 2021-01-22 at 21 41 37

Screen Shot 2021-01-22 at 21 41 58

in my case it was solved the issue, hope it help

kesha-antonov commented 3 years ago

Fixed it by setting same iOS version in all places. Thanks guys.

Screenshot 2021-01-27 at 22 13 14 Screenshot 2021-01-27 at 22 12 45 Screenshot 2021-01-27 at 22 08 49
DirleiDionisio commented 3 years ago

Thank you @nahuelb! Following your solution worked out. 🤜🤛

KasTasElis commented 3 years ago

@vassilmladenov @belgamo By any chance you opened on Xcode .xcodeproj file instead of .xcworkspace file?

I am not sure why, but this was a game changer for me! App was not building in .xcodeproj but .xcworkspace built just fine!

jkz27 commented 3 years ago

@zxcpoiu solution worked for me <3 It seems Rebooting is actually necessary What I did, personally using deployment stage IOS 10

  1. rm -rf ios/Pods, rm ios/Podfile.lock
  2. cd ios, pod cache clean --all
  3. Reboot
  4. pod repo update, pod install
Liviu-Icedo-web commented 3 years ago

In my case was because ofios/APPNAME/Info.plist. Please check also if your .plistfile is as you wanted it to be.

lavajeff commented 3 years ago

@zxcpoiu solution worked for me <3 It seems Rebooting is actually necessary What I did, personally using deployment stage IOS 10

  1. rm -rf ios/Pods, rm ios/Podfile.lock
  2. cd ios, pod cache clean --all
  3. Reboot
  4. pod repo update, pod install

This worked for me. Thank you so much for saving me from hours of fixing this issue.