-
Notifications
You must be signed in to change notification settings - Fork 402
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
Error compiling with React Native 0.61.0 with Xcode: "'React/RCTBridgeModule.h' file not found" #182
Comments
Fixed it by adding a The steps below are probably only for react native 0.61.0 and higher. Not tested with a lower version. Please do not use my forked package mentioned below in your project, as I do not give support for that. I've forked this share extension project to fit my needs only. And to provide an example for others.
# My app only supports iOS 11 and up, this might also be relevant to know
platform :ios, '11.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
# "YourApp" needs to be the name of your app as already defined in the Podfile
target 'YourApp' do
# React pods taken from: https://github.com/facebook/react-native/blob/v0.61.2/template/ios/Podfile
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
# Your share extension pod
pod 'ReactNativeShareExtension', :podspec => '../node_modules/react-native-share-extension/ReactNativeShareExtension.podspec'
# Add this:
use_native_modules!
# Add this below your pods. Where "YourAppShareExtension" is your Share Extension's target name
target 'YourAppShareExtension' do
use_native_modules!
inherit! :complete
end
end
# Add this, taken from: https://github.com/facebook/react-native/issues/25792#issuecomment-517295859
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
end
end
end
Example my main target:
Example my extension target:
|
I NEED HELP!!!
|
You'll first have to follow the readme like here: https://github.com/alinz/react-native-share-extension#setup except for the part about where you need to add the static libraries. That's not relevant anymore for react-native 0.61.*, so you can skip that. Then come back here and follow the steps mentioned above. |
I'm getting the same error on a fresh
|
I have the same issue ( |
I managed to fix the error by adding then adding :
just before |
I indeed got some more feedback about steps needed to get it working. However, the header search path thing is something from the original readme.
Well, it should work, but I probably forgot something |
I've update the steps above about changes needed in the Podfile and header search paths. Also added you need to open the It's important your project builds correctly without any share extension active first, to rule out any problem with your own react native setup. Hope this might help others. Easier solution for new users would be a seperate fork with the current state of this project, but with an updated readme and a It seems this share extension project is abandoned unfortunately. However, if the above steps still don't help, I could help developers set this up using a screen sharing session and a small fee. Just contact me on Linkedin. Already made a developer very happy with a working setup. |
I got it working on both iOS and Android for RN 0.61.2 following these latest instructions. Thanks! |
I am using 0.60.4 and I having the compiling error : React/RCTBridgeModule.h file not found
Thank you very much in advanced. |
It’s important to use React Native 0.61.0 or higher using the steps above. As that resolves 1. If you cannot upgrade to that version this issue cannot help you, as it contains 0.61.x specifics |
Hey i have done this setup, my share extension is showing up, but when i click on it, it opens a transparent screen, doesn't load anything from my React Code |
Running in to same issue as @Epiczzor. My config is: |
Please create an other issue for 0.60.x and lower. So we can keep this for 0.61.x, as there are differences between those versions on how to get this to work |
After reviewing my code I made decision to start config from the scratch. @Epiczzor I made it work by doing exactly the same as @jvandenaardweg describe in a beginning of this tread. Transparent Modal show-up and in 2-3 seconds ReactNative View for share extension appear as well. So this manual works for ReactNative 0.60.5 and IOS: 13.1.2. |
On 0.61.0 and following @jvandenaardweg's instructions in the second post gets me to a point with the following error output on build of my share ext (note that
Has anyone experienced this? If not, does anyone know what could cause such an error? I've been stuck at this stage, messing around with different settings that I don't fully understand for hours now. I feel like I've read through and followed the main repo instructions + @jvandenaardweg's enough times now that I'm fairly confident I'm not missing any steps, although I always get back to this point. |
I'm using 0.61 and followed all the steps and my view is not loading up, its transparent no matter how long i wait |
Try add $(inherited) to top of Build Settings -> Other Linker Flags |
do you guys have a .h file for the share extension ? |
Thanks a lot @saveliy-kremen, that solved that error and got me to the next one. Eventually, after working through a few more, I ended up getting a successful build :) These are probably fairly obvious things to do, though I'm still fairly new to React Native and generally have no idea what's going on when I have to do things via XCode. Though I slowly seem to be getting a better idea of some common interactions, like dealing with deps and build settings. Hopefully this is useful for others. |
Swift errors should not be related to this share extension package, as it does not use Swift. I think it's better to find out which package uses Swift and see in the docs of that package if the setup is done correctly. It seems like you use Lotti, maybe one of these issues will help you if this is the package you use: https://github.com/react-native-community/lottie-react-native/issues?utf8=%E2%9C%93&q=linker To give you some hope: I'm also using packages that need Swift, so it's possible to get it working. But setup differs per package. The suggestion above to create a bridging header is something i've also done, but that was required for the package i've used. |
@lichwa , @jvandenaardweg Thanks! But my project already had dummy swift file and bridging header file. |
Hey guys, im following the steps like you said, but i start getting discrepancies from Step 13 onwards, libReactNativeConfig is not present in my project, it doesnt show up in the list. Also doesn't show up in Manage Schemes like mentioned in step 18 everything else is on point My Build is successful and I get a transparent page, i suspect the code is not opening my JS page at all. Not sure how to check logs please help me out on this issues #188 |
If you are familiar with how react native works, then you know that So it's not required if your project doesn't have it. I'll remove it from the steps to prevent confusion. |
Ohh! Thanks a lot, Also in Step 18 React didn't show up in Pods/React when adding it to the scehme |
Just saw the logs:
|
@Epiczzor |
Yeah, its not there in the list, |
Editted step 20: Make sure the Header Search Paths in Build Settings in your main app target ánd share extension target has $(inherited) on top with non-recursive selected. Delete any other reference except the ones your app really needs. To Make sure the For other struggling with getting this to work: make sure you also follow the steps in the original readme from this package. As I notice when I help others with this, mostly some of those steps from the original readme are missing. |
Successfully built my project using the steps but after share app press the react-native view not rendering and screen freezes. Maybe someone has encountered a similar problem? |
I recently helped another developer with the setup of this which had the same problem. I notice the following was missing in his setup: Targets -> "ShareExtension" -> Build Phases -> Run Script:
Add it by: Select your "ShareExtension" target -> In the top menu: Editor -> Add Build Phase -> Add Run Script Build Phase. Which is actually part of the original readme. Might be unrelated, but I also noticed I had this in my
|
Please help us to implement this into my project.. I am using react native 0.62.2 |
$(inherited) added in other link flags in my app share extension. but its not resolved.. Please help us |
Why: * RN > 0.60 requires to link libs automatically, so we need to add a `podspec` file to reference it in projects `Podfile`. Based on: alinz#182 (comment) How: * Add `podspec` file.
i ve used this package with all new features with react native greater than 0.60 support react-native-receive-sharing-intent |
Thanks @jvandenaardweg |
We needed one additional step to get this working with rn 0.60.6 which was to remove Ultimately the steps we took to get this working with 0.60.6 were:
Thanks for all your work on this @jvandenaardweg |
Got it working on 0.63.2 by following above comment, but without the need to update the
Thanks @jvandenaardweg |
My project stopped building as soon as I updated to the latest React Native version: 0.61.0. Had it working perfectly in 0.60.5 and lower.
Examining the error I notice this is probably related to the absence of
node_modules/react-native/React.xcodeproj
since 0.61.0. As adding that file to theLibraries
folder in Xcode ánd using it as aDepedency
underBuild Phases
did the trick in resolving the "'React/RCTBridgeModule.h' file not found" error in 0.60.5 and below. Also mentioned here.Does anybody have an idea to get this to work again without
React.xcodeproj
?I already tried updating the header search paths. But that does not work:
Error details:
react-native-share-extension/ios/ReactNativeShareExtension.h
The text was updated successfully, but these errors were encountered: