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

restore react-native link functionality #349

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
@koenpunt
Copy link
Contributor

commented Jul 1, 2017

react-native link doesn't support the new xml format yet, so for now we save it in the old format

restore react-native link functionality
react-native link doesn't support the new xml format yet, so for now we save it in the old format
@logan-lvx3

This comment has been minimized.

Copy link

commented Jul 13, 2017

Is there any workaround for this? I haven't been able to get even fbsdk v 0.5.0 to work with my new project.

1DD70E29001F47FB00000002 /* BUCK */ = {isa = PBXFileReference; explicitFileType = text.script.python; path = BUCK; sourceTree = SOURCE_ROOT; };
1DD70E29001F47FB00000003 /* BUCK */ = {isa = PBXFileReference; explicitFileType = text.script.python; path = BUCK; sourceTree = SOURCE_ROOT; };
1DD70E2900B6388300000000 /* libRNSDKShareKit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; name = libRNSDKShareKit.a; path = lib.a; sourceTree = BUILT_PRODUCTS_DIR; };

This comment has been minimized.

Copy link
@paulftw

paulftw Jul 14, 2017

path = lib.a on my machine means XCode will compile multiple different libraries into lib.a causing all sorts of troubles.
I have to manually set Product Name on each of the targets to stop that from happening.
Otherwise this is a change I'd really love to see merged into master.

@paulftw

This comment has been minimized.

Copy link

commented Jul 15, 2017

As a follow up to my review comment attaching the modifications I have on top of this PR. This addition makes pod install do the right job for new projects with Xcode 8.3.3.

--- project.pbxproj.1	2017-07-15 22:39:52.000000000 +1000
+++ project.pbxproj	2017-07-15 21:52:04.000000000 +1000
@@ -33,12 +33,12 @@
 		1DD70E29001F47FB00000001 /* BUCK */ = {isa = PBXFileReference; explicitFileType = text.script.python; path = BUCK; sourceTree = SOURCE_ROOT; };
 		1DD70E29001F47FB00000002 /* BUCK */ = {isa = PBXFileReference; explicitFileType = text.script.python; path = BUCK; sourceTree = SOURCE_ROOT; };
 		1DD70E29001F47FB00000003 /* BUCK */ = {isa = PBXFileReference; explicitFileType = text.script.python; path = BUCK; sourceTree = SOURCE_ROOT; };
-		1DD70E2900B6388300000000 /* libRNSDKShareKit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; name = libRNSDKShareKit.a; path = lib.a; sourceTree = BUILT_PRODUCTS_DIR; };
-		1DD70E29031DBF3900000000 /* libRNSDKLoginKit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; name = libRNSDKLoginKit.a; path = lib.a; sourceTree = BUILT_PRODUCTS_DIR; };
+		1DD70E2900B6388300000000 /* libRNSDKShareKit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRNSDKShareKit.a; sourceTree = BUILT_PRODUCTS_DIR; };
+		1DD70E29031DBF3900000000 /* libRNSDKLoginKit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRNSDKLoginKit.a; sourceTree = BUILT_PRODUCTS_DIR; };
 		1DD70E291591D1EC00000000 /* RNSDKShareKit-Release.xcconfig */ = {isa = PBXFileReference; explicitFileType = text.xcconfig; name = "RNSDKShareKit-Release.xcconfig"; path = "../../../../../buck-out/gen/Libraries/FBReactKit/js/react-native-fbsdk/ios/RNSDKShareKit-Release.xcconfig"; sourceTree = SOURCE_ROOT; };
 		1DD70E291A45CB9900000000 /* RCTFBSDKAppEvents.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RCTFBSDKAppEvents.h; path = RCTFBSDK/core/RCTFBSDKAppEvents.h; sourceTree = SOURCE_ROOT; };
 		1DD70E291A45CB9E00000000 /* RCTFBSDKAppEvents.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RCTFBSDKAppEvents.m; path = RCTFBSDK/core/RCTFBSDKAppEvents.m; sourceTree = SOURCE_ROOT; };
-		1DD70E291ECB10AC00000000 /* libRNSDK.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; name = libRNSDK.a; path = lib.a; sourceTree = BUILT_PRODUCTS_DIR; };
+		1DD70E291ECB10AC00000000 /* libRNSDK.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRNSDK.a; sourceTree = BUILT_PRODUCTS_DIR; };
 		1DD70E2920FC65B100000000 /* RCTFBSDKAppInviteDialog.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RCTFBSDKAppInviteDialog.h; path = RCTFBSDK/share/RCTFBSDKAppInviteDialog.h; sourceTree = SOURCE_ROOT; };
 		1DD70E2920FC65B600000000 /* RCTFBSDKAppInviteDialog.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RCTFBSDKAppInviteDialog.m; path = RCTFBSDK/share/RCTFBSDKAppInviteDialog.m; sourceTree = SOURCE_ROOT; };
 		1DD70E29239FB7EC00000000 /* RCTConvert+FBSDKAccessToken.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "RCTConvert+FBSDKAccessToken.h"; path = "RCTFBSDK/core/RCTConvert+FBSDKAccessToken.h"; sourceTree = SOURCE_ROOT; };
@@ -65,7 +65,7 @@
 		1DD70E29A1FB268A00000000 /* RNSDKShareKit-Profile.xcconfig */ = {isa = PBXFileReference; explicitFileType = text.xcconfig; name = "RNSDKShareKit-Profile.xcconfig"; path = "../../../../../buck-out/gen/Libraries/FBReactKit/js/react-native-fbsdk/ios/RNSDKShareKit-Profile.xcconfig"; sourceTree = SOURCE_ROOT; };
 		1DD70E29A8F8915900000000 /* RCTFBSDKLoginManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RCTFBSDKLoginManager.h; path = RCTFBSDK/login/RCTFBSDKLoginManager.h; sourceTree = SOURCE_ROOT; };
 		1DD70E29A8F8915E00000000 /* RCTFBSDKLoginManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RCTFBSDKLoginManager.m; path = RCTFBSDK/login/RCTFBSDKLoginManager.m; sourceTree = SOURCE_ROOT; };
-		1DD70E29AC0CD5F100000000 /* libRNSDKCoreKit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; name = libRNSDKCoreKit.a; path = lib.a; sourceTree = BUILT_PRODUCTS_DIR; };
+		1DD70E29AC0CD5F100000000 /* libRNSDKCoreKit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRNSDKCoreKit.a; sourceTree = BUILT_PRODUCTS_DIR; };
 		1DD70E29B8E1424100000000 /* RNSDK-Profile.xcconfig */ = {isa = PBXFileReference; explicitFileType = text.xcconfig; name = "RNSDK-Profile.xcconfig"; path = "../../../../../buck-out/gen/Libraries/FBReactKit/js/react-native-fbsdk/ios/RNSDK-Profile.xcconfig"; sourceTree = SOURCE_ROOT; };
 		1DD70E29BECE3BF400000000 /* RCTFBSDKAccessToken.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RCTFBSDKAccessToken.h; path = RCTFBSDK/core/RCTFBSDKAccessToken.h; sourceTree = SOURCE_ROOT; };
 		1DD70E29BECE3BF900000000 /* RCTFBSDKAccessToken.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RCTFBSDKAccessToken.m; path = RCTFBSDK/core/RCTFBSDKAccessToken.m; sourceTree = SOURCE_ROOT; };
@@ -378,6 +378,7 @@
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = 1DD70E29C049749700000000 /* RNSDK-Debug.xcconfig */;
 			buildSettings = {
+				PRODUCT_NAME = RNSDK;
 			};
 			name = Debug;
 		};
@@ -385,6 +386,7 @@
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = 1DD70E29F349631C00000000 /* RNSDKCoreKit-Debug.xcconfig */;
 			buildSettings = {
+				PRODUCT_NAME = RNSDKCoreKit;
 			};
 			name = Debug;
 		};
@@ -392,6 +394,7 @@
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = 1DD70E297A21682A00000000 /* RNSDKLoginKit-Debug.xcconfig */;
 			buildSettings = {
+				PRODUCT_NAME = RNSDKLoginKit;
 			};
 			name = Debug;
 		};
@@ -399,6 +402,7 @@
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = 1DD70E2971F1D72000000000 /* RNSDKShareKit-Debug.xcconfig */;
 			buildSettings = {
+				PRODUCT_NAME = RNSDKShareKit;
 			};
 			name = Debug;
 		};
@@ -412,6 +416,7 @@
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = 1DD70E29B8E1424100000000 /* RNSDK-Profile.xcconfig */;
 			buildSettings = {
+				PRODUCT_NAME = RNSDK;
 			};
 			name = Profile;
 		};
@@ -419,6 +424,7 @@
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = 1DD70E292B9FA38600000000 /* RNSDKCoreKit-Profile.xcconfig */;
 			buildSettings = {
+				PRODUCT_NAME = RNSDKCoreKit;
 			};
 			name = Profile;
 		};
@@ -426,6 +432,7 @@
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = 1DD70E295C8A9D1400000000 /* RNSDKLoginKit-Profile.xcconfig */;
 			buildSettings = {
+				PRODUCT_NAME = RNSDKLoginKit;
 			};
 			name = Profile;
 		};
@@ -433,6 +440,7 @@
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = 1DD70E29A1FB268A00000000 /* RNSDKShareKit-Profile.xcconfig */;
 			buildSettings = {
+				PRODUCT_NAME = RNSDKShareKit;
 			};
 			name = Profile;
 		};
@@ -446,6 +454,7 @@
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = 1DD70E292C77EDA300000000 /* RNSDK-Release.xcconfig */;
 			buildSettings = {
+				PRODUCT_NAME = RNSDK;
 			};
 			name = Release;
 		};
@@ -453,6 +462,7 @@
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = 1DD70E299F364EE800000000 /* RNSDKCoreKit-Release.xcconfig */;
 			buildSettings = {
+				PRODUCT_NAME = RNSDKCoreKit;
 			};
 			name = Release;
 		};
@@ -460,6 +470,7 @@
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = 1DD70E29D021487600000000 /* RNSDKLoginKit-Release.xcconfig */;
 			buildSettings = {
+				PRODUCT_NAME = RNSDKLoginKit;
 			};
 			name = Release;
 		};
@@ -467,6 +478,7 @@
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = 1DD70E291591D1EC00000000 /* RNSDKShareKit-Release.xcconfig */;
 			buildSettings = {
+				PRODUCT_NAME = RNSDKShareKit;
 			};
 			name = Release;
 		};
@koenpunt

This comment has been minimized.

Copy link
Contributor Author

commented Jul 16, 2017

@paulftw I don't know, I just opened the project in Xcode, en saved it again. I didn't change anything. You'll probably have the same issue with xml version?

@matiasfh

This comment has been minimized.

Copy link

commented Jul 23, 2017

Any news about this? Will this be merged back to master ? I'm having issues with the linking process of react-native-fbsdk 0.6.1 and the only way to make it work was manually updating the format of the file ios.xcodeproj .. Would be nice to get this fixed.

@bernardakl

This comment has been minimized.

Copy link

commented Jul 26, 2017

If I run react-native link react-native-fbsdk should I still do the manual setup of android and ios?

@pukhalski

This comment has been minimized.

Copy link

commented Jul 30, 2017

Could it be fixed somehow? It's been already a month since this PR...

@raduflp

This comment has been minimized.

Copy link

commented Aug 5, 2017

waiting for this as well :|

@kevinmcalear

This comment has been minimized.

Copy link

commented Aug 17, 2017

Please update this. It is also blocking me.

@uniquarkD

This comment has been minimized.

Copy link

commented Aug 29, 2017

Same here.

@sospedra

This comment has been minimized.

Copy link

commented Aug 29, 2017

Hello? Is anyone here? Do you realise this lib it's a requirement of your company in order to make money: Facebook's campaigns. And there's no alternative. The PR is done. And yet you still don't even answer :/

@danscan

This comment has been minimized.

Copy link

commented Aug 29, 2017

What action is required for this to be merged?

@victorbadila

This comment has been minimized.

Copy link

commented Sep 11, 2017

  • 1 it's blocking us also. this should be either merged or commented on by the dev. it doesn't make sense to simply ignore the problem :)
@aforty

This comment has been minimized.

Copy link

commented Sep 13, 2017

This package is causing all sorts of problems and no one appears to be watching this project.

@koenpunt

This comment has been minimized.

Copy link
Contributor Author

commented Sep 13, 2017

@aforty

This comment has been minimized.

Copy link

commented Sep 13, 2017

With this branch I'm getting the following. Anyone have any ideas?

ld: library not found for -lRNSDKCoreKit
clang: error: linker command failed with exit code 1 (use -v to see invocation)
@baba43

This comment has been minimized.

Copy link

commented Sep 18, 2017

It's true that we should stay friendly and patient, but it is very frustrating to have this kind of issues open for weeks. You ask for feedback, you get feedback (and a pull request) but this library is still not usable for many people out there, just because we can not get it to work.

Right now I'm figuring around how to get this library working without react-native link what seems very frustrating. If you can not provide a working solution for auto-linking you/we might need to have a little guide on how to link it manually, so that we can get this library working. Especially for people like me that come from Android and are no iOS experts.

For example what about this note:

Make sure that libRCTFBSDK.a shows up in the Link Binary with Libraries section of your build target's Build Phases.

I guess this is my problem, but how do I solve this problem if libRCTFBSDK is not showing up there (because linking is not possible). What should I add there?

@koenpunt

This comment has been minimized.

Copy link
Contributor Author

commented Sep 18, 2017

As a workaround — which has been mentioned in an other issue too I believe — you can navigate to the library in the node_modules folder, open the xcodeproj file in Xcode, change the supported version to something and back (somewhere on the right) and save the file. Then it should be saved in the old plist format and react-native link should work again.

@tzilist

This comment has been minimized.

Copy link

commented Sep 20, 2017

To get this to work right now I had to do npm install -s react-native-fbsdk@0.6.0, which seemed to work.

@VoNam

This comment has been minimized.

Copy link

commented Sep 20, 2017

@baba43 hope this post will give you a sense of how to do it manually
http://www.namvo.me/manual-setup-for-facebook-sdk-in-react-native/

@kytwb

This comment has been minimized.

Copy link

commented Sep 20, 2017

@aforty I went into Xcode > Build Phases > Link Binary With Libraries and removed the libRNSDK*.a files listed there.

@sospedra

This comment has been minimized.

Copy link

commented Sep 20, 2017

Opened on 1st July... ridiculous
Is there any alternative?

kyoyadmoon added a commit to kyoyadmoon/react-native-fbsdk that referenced this pull request Sep 29, 2017

@lexor90

This comment has been minimized.

Copy link

commented Oct 2, 2017

@sospedra Why don't you simply install the one from https://github.com/koenpunt/react-native-fbsdk which is basically this pull request?

I solved it this way:

Remove the previous one:

  • react-native unlink react-native-fbsdk
  • npm r --save react-native-fbsdk

Install the fork which is working (this pull request):

  • npm i --save react-native-fbsdk@https://github.com/koenpunt/react-native-fbsdk#fix-project-for-link
  • react-native link react-native-fbsdk

Then just remember to follow the setup steps again (remember to link frameworks and to set up the framework search path correctly).

By doing this I'm able to run it without any need to tweak the module or xcode project files.

Edit: fix to checkout the proper fix branch

@lepouya

This comment has been minimized.

Copy link
Contributor

commented Oct 5, 2017

Sorry about the delay in responses everyone

Why are you using ios.xcodeproj? You should only be needing RCTFBSDK

@koenpunt

This comment has been minimized.

Copy link
Contributor Author

commented Oct 5, 2017

Why are you using ios.xcodeproj? You should only be needing RCTFBSDK

Not really using, but react-native link tries to parse the file, which doesn't work.

@lepouya

This comment has been minimized.

Copy link
Contributor

commented Oct 5, 2017

Oh I see
I'll remove it from the repo then :) Thanks for the info

@lepouya

This comment has been minimized.

Copy link
Contributor

commented Oct 9, 2017

File removed

@lepouya lepouya closed this Oct 9, 2017

@koenpunt koenpunt deleted the koenpunt:fix-project-for-link branch Oct 9, 2017

@sospedra

This comment has been minimized.

Copy link

commented Oct 10, 2017

@lexor90 well, simply because this is the official one 💁

@lexor90

This comment has been minimized.

Copy link

commented Oct 10, 2017

I know, but if the latest version is broken and there’s a fork to patch it, as long as you can verify what actually changed from the main version I think it can be a viable solution (especially when things are going to be merged probably). At least you don’t have to patch things locally meaning you will not be able to repeat the build process without repeating the same steps which is not really scalable.

Btw, I just wanted to give you a quick workaround.

@sospedra

This comment has been minimized.

Copy link

commented Oct 10, 2017

Agree. In the case of my company is just that this is -- at the end-- just a workaround. And we feel that an organization such as Facebook should provide a stable solution. As I said in previous comments, specially for a feature like this one from where Facebook actually profits a lot of money.

@eurobob

This comment has been minimized.

Copy link

commented Oct 12, 2017

@koenpunt why delete the branch? What's the current solution?

@koenpunt

This comment has been minimized.

Copy link
Contributor Author

commented Oct 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.