I'm not sure if this is a bug with rnpm. I was trying to run
react-native link react-native-fbsdk
and got this error:
rnpm-install info Android module react-native-fbsdk is already linked
rnpm-install info Linking react-native-fbsdk ios dependency
rnpm-install ERR! Something went wrong while linking. Error: Expected "/*", "//", or "{" but "<" found.
Please file an issue here: https://github.com/facebook/react-native/issues
Expected "/*", "//", or "{" but "<" found.
+1
+1
delete package-lock.json and redo npm install, the npm 5 is broken, you either always have to delete package-lock.json and redo npm install or just use npm 4
I followed the steps and am still getting the error
I ran
npm install --save [email protected]
react-native link react-native-fbsdk
Everything worked fine
Finally I updated my react-natvie-fbsdk by running
npm update react-native-fbsdk
npm install --save [email protected]
react-native link react-native-fbsdk
it is ok
but if you forget update to latest, android will get a trouble in build.gradle
you need to change
compile('com.facebook.android:facebook-android-sdk:4.+')
to
compile('com.facebook.android:facebook-android-sdk:4.22.1')
@manggit I can run that command ok, but for every subsequent react-native link
i run, i hit the same error at Linking react-native-fbsdk ios dependency
@Charles-LMQ your suggestion worked. It didn't work at first so I had to upgrade from npm 3.3.9 to 5.0.4 then went down to 0.6.0 for fbsdk.
dependencies": {
"native-base": "^2.2.0",
"react": "16.0.0-alpha.12",
"react-native": "^0.45.1",
"react-native-deprecated-custom-components": "^0.1.0",
"react-native-fbsdk": "^0.6.0"
},
@thienpow - this has nothing to do with package-lock.json from what i can tell. Removed it multiple times and nada.
Also hitting this. Installing 0.6.0 works however.
looks like the issue is stuck at this PR
https://github.com/facebook/react-native-fbsdk/pull/349
npm install --save [email protected]
then open [yourproject]\node_modules\react-native-fbsdk\androidsrc\main\java\com\facebook\reactnative\androidsdk\FBSDKPackage.java
comment
/*
@Override
public List
return Collections.emptyList();
}*/
then react-native link
every thing will be fine
+1
React-Native: 0.47.2
React-Native-FBSDK: 0.6.0
This works for iOS but how have you got it to run on Android? I keep running into:
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
+1 the workaround involving installing 0.6.0, linking, update to 0.6.1 works but only temporary. each time I need to relink I have to do it again, I think this issue should still be open.
This should absolutely still be open. 0.6.1 does _not_ work with iOS. This makes it necessary to split the project into iOS/Android with two different package.json
. I filed a formal bug at developers.facebook a week ago.
I've tested with a completely clean build at 0.47.2 just for the FBSDK to no avail. You'd have to down-version RN to get 0.6.1 to work but I'm not sure how far down. I've seen reports of 0.45 being ok.
Its works with RN 0.48.1 and FB SDK 0.6.0
Durzas-MacBook-Pro:test0_48_1 durza$ react-native install [email protected]
Scanning 584 folders for symlinks in /Users/durza/test0_48_1/node_modules (7ms)
yarn add v0.27.5
warning ../package.json: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
鈹斺攢 [email protected]
Done in 4.40s.
Scanning 585 folders for symlinks in /Users/durza/test0_48_1/node_modules (6ms)
rnpm-install info Linking react-native-fbsdk android dependency
rnpm-install info Android module react-native-fbsdk has been successfully linked
rnpm-install info Linking react-native-fbsdk ios dependency
rnpm-install info iOS module react-native-fbsdk has been successfully linked
rnpm-install info Module [email protected] has been successfully installed & linked
Right, 0.6.0 works with 0.47.2 as well, 0.6.1 does not. And 0.6.0 does not work with Android/RN 0.47.2. Android requires 0.6.1
Does anybody have a combinaison of versions working on both android and ios ?
RN 0.48.1 & FBSDK 0.6.0 ... working both android & ios
Just received an update on my bug report. Haven't gotten a chance to try this yet but if someone wants to give it a shot...
"_While we work on a fix, as a workaround, can you try deleting the file project.pbxproj
from the React Native SDK and confirm that solves the issue?_"
There is a PR fixing this issue still unmerged: facebook/react-native-fbsdk#349 (as mentioned above by @raduflp).
There is a workaround here: facebook/react-native/issues/14594#issuecomment-315531102.
And another discussion here: facebook/react-native#10032
For the past hours, I am trying unsuccessfully to connect the Facebook SDK in React Native.
0) react-native init demoapp1
0.5) cd demoapp1
1) npm install --save [email protected]
2) react-native link react-native-fbsdk
Scanning folders for symlinks in C:\Users\nicoara\Desktop\demoapp1\node_modules
(41ms)
rnpm-install info Linking react-native-fbsdk android dependency
rnpm-install info Android module react-native-fbsdk has been successfully linked
rnpm-install info Linking react-native-fbsdk ios dependency
rnpm-install info iOS module react-native-fbsdk has been successfully linked
3) open the folder Android from the demoapp1 in Android Studio
shows:
Error:Failed to find Build Tools revision 25.0.3
I click on the solution to install Build Tools 25.0.3
4) now following errors appear:
Error:Failed to resolve: com.android.support:support-annotations:27.0.1
Android Studio has no proposed solution.
also, it does not recognize if I add the following line in MainApplication.java: 'import com.facebook.FacebookSdk'
I am running Windows, Android Studio 2.3.1.
npm --version shows: 4.6.1
my package.json shows:
"react": "16.0.0",
"react-native": "0.51.0",
"react-native-fbsdk": "^0.6.3"
(
if instead of step 1 follow the official documentation at https://developers.facebook.com/docs/react-native/getting-started I receive the next errors:
C:\Users\nicoara\Desktop\demoapp1>react-native install react-native-fbsdk
Scanning folders for symlinks in C:\Users\nicoara\Desktop\demoapp1\node_modules
(42ms)
rnpm-install info Module react-native-fbsdk has been successfully installed & li
nked
C:\Users\nicoara\Desktop\demoapp1>react-native link react-native-fbsdk
Scanning folders for symlinks in C:\Users\nicoara\Desktop\demoapp1\node_modules
(38ms)
{ Error: Cannot find module 'C:\Users\nicoara\Desktop\demoapp1\node_modules\reac
t-native-fbsdkpackage.json'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at getRNPMConfig (C:/Users/nicoara/Desktop/demoapp1/node_modules/react-nativ
e/local-cli/core/index.js:52:3)
at Object.getDependencyConfig (C:/Users/nicoara/Desktop/demoapp1/node_module
s/react-native/local-cli/core/index.js:90:18)
at deps.reduce (C:/Users/nicoara/Desktop/demoapp1/node_modules/react-native/
local-cli/link/getDependencyConfig.js:9:24)
at Array.reduce (native)
at getDependencyConfig (C:/Users/nicoara/Desktop/demoapp1/node_modules/react
-native/local-cli/link/getDependencyConfig.js:6:15)
at Object.link (C:/Users/nicoara/Desktop/demoapp1/node_modules/react-native/
local-cli/link/link.js:180:24) code: 'MODULE_NOT_FOUND' }
and then still, it does not recognize if I add the following line in MainApplication.java: 'import com.facebook.FacebookSdk'
)
How to proceed?
wtf it's been a whole day trying installing this framework on osx for ios without success...
What's wrong with you guys who developed this package?
isn't it supposed to ease the use of fbsdk into RN apps?...
my config:
xcode 9.0
RN: 0.52.0
react-native-fbsdk: 0.7.0
on android is working.
on ios there is NO WAY to make it work. tried everything, from manually importing/linking libraries, to use custom pods.. :(
please some advice, as the docs on FB developer website seems to be broken or at least not working for me.
I upgraded react-native-fbsdk to 0.7.0, now IOS stopped working, I see just white screen, when trying to log in/sign up via Facebook. I was trying to downgrade react-native-fbsdk back to 0.6.0, 0.6.2, but this white empty screen is still there. Android works fine. Any advice how is possible to fix that?
RN: 0.47.2
Most helpful comment
I ran
npm install --save [email protected] react-native link react-native-fbsdk
Everything worked fine
Finally I updated my react-natvie-fbsdk by running
npm update react-native-fbsdk