Open seclace opened 6 years ago
I've installed this lib via npm today, and got this error
.../node_modules/react-native-social-share/iOS/AppDelegate.m:12:9: fatal error: 'RCTRootView.h' file not found
And everything started to work correctly after I removed this two objects that were added after running react-native link react-native-social-share
I hope it helps
I just discovered this project and noticed that the instructions were different from various other libraries. After discovering the same two items that @facuescobar saw in the link phase, I abandoned the react-native link
part of the documentation (for iOS only really — by reverting the changes that were made during the link).
Ideally this library would produce a linkable static library for iOS like other RN extensions do which would also allow the removal of all of the fiddling in the Xcode project since those things would be handled automatically.
Hey @wbyoung Thank you for sharing your find. I think it sounds like a good solution. Do you know how to produce a linkable static library for iOS? I would be happy to accept a PR 😄
@doefler I do… unfortunately I don't have time right now. Also, at this point I was just investigating this library and as we solidified the feature I was building we decided it wasn't needed, so I can't quite justify the time on it right now. I can point to libraries that I know do this, though if it helps:
I've only contributed to these types of libraries at this point & haven't built one from scratch, but since most of them support linking in the same style, I'd imagine that a guide or template exists that shows how to do it in the "standard" way that all of these libraries are doing. That sort of thing may not have existed when you started this project, but perhaps it does now.
Best of luck & if we do end up needing this, I'll try to send something your way!
@facuescobar where did you find those two objects to delete? I could see them in "recovered references" but not in a similar way to your screenshot, and deleting them did nothing - thanks!
@dancherb This is a little late, but @facuescobar is referring to "un-linking" the libraries.
On your Project tab -> Build Phases -> Link Binary With Libraries, select both ReactNativeSocialShare.app
and ReactNativeSocialShareTests.xctest
, and click - to remove them both from your linked libraries. That should clear up the build error.
Hopefully that helps!
Description
Hi. It is very interesting module and I want to integrate it into my app, but can't. I followed all the instructions in README.md:
LSApplicationQueriesSchemes
to Info.plist with fb and twitter values Then I ranreact-native run-ios
orCMD+R
in xcode.First error is
'RCTRootView.h' file not found
on 12 line ofLibraries/ReactNativeSocialShare.xcodeproj/ReactNativeSocialShare/AppDelegate.m
Solution:
#import "RCTRootView.h"
could be replaced to#import <React/RCTRootView.h>
and this error disappears.Go further. Next error after "fix" is
No visible @interface for 'RCTRootView' declares the selector 'initWithBundleURL:moduleName:launchOptions:'
Solution: Last error disappears after adding
initialProperties:nil
to rootView declaration inReactNativeSocialShare/AppDelegate.m
, because interface doesn't seems to be identical with used.Further. Appears another error
ld: library not found for -lRCTWebSocketDebugger clang: error: linker command failed with exit code 1 (use -v to see invocation)
Solution: As I seen in previous issues I need to remove
RCTWebSocketDebugger
fromBuild Phases -> Link Binary from Libraries
ofReactNativeSocialShare.xcodeproj
.After latest "fix" another error has appeared
ld: library not found for -lRCTAdSupport clang: error: linker command failed with exit code 1 (use -v to see invocation)
and if remove this binary from "Linking" then appears 155 errors.Solution: not found 😞
I believe it is wrong way. Neither I am doing something wrong nor I don't understand the manual and could you, please, go me through the manual?
P.S.
I'm using cocoapods, but it's not matter, because I tried with clear
react-native init ProjectName
and got the same errors.Versions:
package.json