Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

restore react-native link functionality #349

Closed

Conversation

koenpunt
Copy link
Contributor

@koenpunt koenpunt 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

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

ghost 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; };
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

paulftw 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
Copy link
Contributor Author

@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?

@matiasfha
Copy link

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
Copy link

bernardakl 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
Copy link

pukhalski commented Jul 30, 2017

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

@raduflp
Copy link

raduflp commented Aug 5, 2017

waiting for this as well :|

@kevinmcalear
Copy link

Please update this. It is also blocking me.

@uniquarkD
Copy link

Same here.

@sospedra
Copy link

sospedra 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
Copy link

danscan commented Aug 29, 2017

What action is required for this to be merged?

@victorbadila
Copy link

  • 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
Copy link

aforty commented Sep 13, 2017

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

@koenpunt
Copy link
Contributor Author

koenpunt commented Sep 13, 2017

@aforty https://code.facebook.com/pages/876921332402685/open-source-code-of-conduct

Be friendly and patient.

@aforty
Copy link

aforty 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
Copy link

baba43 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
Copy link
Contributor Author

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
Copy link

tzilist 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.

@namvox
Copy link

namvox 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/

@ghost
Copy link

ghost commented Sep 20, 2017

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

@sospedra
Copy link

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
Copy link

lexor90 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
Copy link
Contributor

lepouya commented Oct 5, 2017

Sorry about the delay in responses everyone

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

@koenpunt
Copy link
Contributor Author

koenpunt 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
Copy link
Contributor

lepouya commented Oct 5, 2017

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

@lepouya
Copy link
Contributor

lepouya commented Oct 9, 2017

File removed

@lepouya lepouya closed this Oct 9, 2017
@koenpunt koenpunt deleted the fix-project-for-link branch October 9, 2017 22:14
@sospedra
Copy link

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

@lexor90
Copy link

lexor90 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
Copy link

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
Copy link

eurobob commented Oct 12, 2017

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

@koenpunt
Copy link
Contributor Author

@eurobob #349 (comment)

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

Successfully merging this pull request may close these issues.