Open akhter004 opened 5 years ago
You haven't linked the library yet? Use react-native link react-native-fbsdk
I have link also but getting this error
On Wed, 11 Sep 2019, 12:19 pm Duy Tran, notifications@github.com wrote:
You haven't linked the library yet? Use react-native link react-native-fbsdk Also, config at MainApplication.java https://github.com/facebook/react-native-fbsdk#androidappsrcmainmainapplicationjava since the previous command not working at this file.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/facebook/react-native-fbsdk/issues/639?email_source=notifications&email_token=AG3MOEJYNWAGTOVQ5X76S6TQJCIGXA5CNFSM4IVOS622YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6NOYYY#issuecomment-530246755, or mute the thread https://github.com/notifications/unsubscribe-auth/AG3MOEPYX3QBUMFAMUNZBHDQJCIGXANCNFSM4IVOS62Q .
Also checking the manually linking to make sure the link command did all things true https://github.com/facebook/react-native-fbsdk#androidsettingsgradle
PFA.
even I am following this - https://github.com/facebook/react-native-fbsdk#installation
On Thu, Sep 12, 2019 at 8:24 AM Duy Tran notifications@github.com wrote:
Also checking the manually linking to make sure the link command did all things true https://github.com/facebook/react-native-fbsdk#androidsettingsgradle
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/facebook/react-native-fbsdk/issues/639?email_source=notifications&email_token=AG3MOEKUTSB2HF3LAGDBMBLQJGVPRA5CNFSM4IVOS622YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6QPSWQ#issuecomment-530643290, or mute the thread https://github.com/notifications/unsubscribe-auth/AG3MOEKQW6NESQBEDL52EUTQJGVPRANCNFSM4IVOS62Q .
-- Thanks & Regards Akhter Ali Ansari
PFA, if I add the selected part in build.gradle inside the dependencies then getting this "Could not find method implementation() for arguments [project ':react-native-fbsdk'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. "
On Thu, Sep 12, 2019 at 8:31 AM Akhtar Ansari akhter004@gmail.com wrote:
PFA.
even I am following this - https://github.com/facebook/react-native-fbsdk#installation
On Thu, Sep 12, 2019 at 8:24 AM Duy Tran notifications@github.com wrote:
Also checking the manually linking to make sure the link command did all things true https://github.com/facebook/react-native-fbsdk#androidsettingsgradle
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/facebook/react-native-fbsdk/issues/639?email_source=notifications&email_token=AG3MOEKUTSB2HF3LAGDBMBLQJGVPRA5CNFSM4IVOS622YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6QPSWQ#issuecomment-530643290, or mute the thread https://github.com/notifications/unsubscribe-auth/AG3MOEKQW6NESQBEDL52EUTQJGVPRANCNFSM4IVOS62Q .
-- Thanks & Regards Akhter Ali Ansari
-- Thanks & Regards Akhter Ali Ansari
Make sure your root build.gradle file like this
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
}
}
Hi, i'm using React Native 0.60.5 and i faced the same error. But I could solve it this way:
First I followed the regular installation instructions for RN 0.60+ exactly (Steps 1. and 2. on Readme) and then, the configure project instructions (3.1 on Readme).
Then, the only extra thing I needed to do to get rid of this error was to edit the MainApplication.java
file as explained on the Readme on the Manually link the library on Android
section (2. on the Readme)
+1 same issue. followed instructions, using version 3, even link
doesn't work
For the people who still have this issue.
I managed to make it work thus realizing that I'm using react-native-navigation
.
When you're using react-native-navigation
you've a custom MainApplication.java
file.
I suppose because of that react-native
didn't success to add the package as described here :
https://github.com/facebook/react-native-fbsdk#androidappsrcmainmainapplicationjava.
So, I did it manually.
Btw, I didn't success make it works without using npx react-native link
.
PS: sorry for my english :+1:
package.json { "name": "MyApp", "version": "0.0.1", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest", "ios": "react-native run-ios", "android": "react-native run-android" }, "dependencies": { "link": "^0.1.5", "react": "16.8.3", "react-native": "^0.59.9", "react-native-fbsdk": "^1.0.3" }, "devDependencies": { "@babel/core": "7.4.5", "@babel/runtime": "7.4.5", "babel-jest": "24.8.0", "jest": "24.8.0", "metro-react-native-babel-preset": "0.54.1", "react-test-renderer": "16.8.3" }, "jest": { "preset": "react-native" } }
App.js
import React, {Component} from 'react'; import {Platform, StyleSheet, Text, View, StatusBar} from 'react-native'; import { LoginButton, AccessToken } from 'react-native-fbsdk';
type Props = {}; export default class App extends Component {
render() {
return (
} }
const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#05818D', }, welcome: { fontSize: 20, textAlign: 'center', margin: 10, color:'#fff' }, instructions: { textAlign: 'center', color: '#333333', marginBottom: 5, }, });
Error-