본문 바로가기
React Native/Error

[React Native / 에러해결] 페이스북 로그인 에러, null is not an object (evaluating ‘LoginManager.loginWithReadPermissions’

by Juzero 2022. 1. 8.

1. 에러 상황

 

페이스북 로그인 기능을 구현하는 중에 LoginManager에서 에러가 발생함.

 

Possible Unhandled Promise Rejection (id:0): TypeErro: null is not an object (evaluating ‘LoginManager.loginWithReadPermissions’

 

 

 

2. 해결방법

 

아래의 깃헙 링크를 참조해서 해결했습니다!

https://github.com/fbsamples/f8app/issues/118

 

Log In With Facebook - ALERT - undefined is not an object (evaluating ‘LoginManager.loginWithReadPermissions’) · Issue #118

In iOS simulator on a Mac OS X machine, when clicking the Log In With Facebook button under the My F8 tab, I am getting an ALERT box: Alert: undefined is not an object (evaluating ‘LoginManager.log...

github.com

 

1) 아래 깃헙 링크에서 Souce Code 압축파일을 다운로드합니다. 

 

https://github.com/facebookarchive/react-native-fbsdk/releases

 

Releases · facebookarchive/react-native-fbsdk

A React Native wrapper around the Facebook SDKs for Android and iOS. Provides access to Facebook login, sharing, graph requests, app events etc. - facebookarchive/react-native-fbsdk

github.com

 

 

2) Xcode에서 프로젝트를 열고, 다운받은 폴더에서 ios 폴더에 있는 RCTFBSDK.xcodeproj 를 Xcode의 Libraries에 드래그해서 넣습니다.

 

저 파일을

 

 

여기에다가 집어넣습니다. 

 

3) Build Phases > Link Binary With Libraries에 libRCTFBSDA.a를 추가합니다.

 

 

 

끝!