react-native-fbsdk error can't run react-native run-android

Created on 24 Oct 2018  路  15Comments  路  Source: facebook/react-native

can't able to run app because of react-native-fbsdk

Environment

Task :react-native-fbsdk:compileDebugJavaWithJavac FAILED
/Users/jacmacos2/Desktop/Nishit/MWM/MWM/node_modules/react-native-fbsdk/android/src/main/java/com/facebook/reactnative/androidsdk/FBGraphRequestModule.java:155: error: no suitable constructor found for AccessToken(String,String,String,,,,,)
graphRequest.setAccessToken(new AccessToken(
^
constructor AccessToken.AccessToken(String,String,String,Collection,Collection,AccessTokenSource,Date,Date,Date) is not applicable
(actual and formal argument lists differ in length)
constructor AccessToken.AccessToken(Parcel) is not applicable
(actual and formal argument lists differ in length)
/Users/jacmacos2/Desktop/Nishit/MWM/MWM/node_modules/react-native-fbsdk/android/src/main/java/com/facebook/reactnative/androidsdk/Utility.java:64: error: no suitable constructor found for AccessToken(String,String,String,List,List,AccessTokenSource,Date,Date)
return new AccessToken(
^
constructor AccessToken.AccessToken(String,String,String,Collection,Collection,AccessTokenSource,Date,Date,Date) is not applicable
(actual and formal argument lists differ in length)
constructor AccessToken.AccessToken(Parcel) is not applicable
(actual and formal argument lists differ in length)
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/jacmacos2/Desktop/Nishit/MWM/MWM/node_modules/react-native-fbsdk/android/src/main/java/com/facebook/reactnative/androidsdk/Utility.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':react-native-fbsdk:compileDebugJavaWithJavac'.

    Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 6s
124 actionable tasks: 2 executed, 122 up-to-date
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

Description

react-native version - 0.56.0

can't build apk or run the app in emulator..react-native run-android stuck at above error and BUILD FAILED

Android Locked

Most helpful comment

I had the same issue today as well, upgrading react-native-fbsdk to 0.8.0 seems to fix it

All 15 comments

Having the same issue. It was working fine till now. No idea why this issue is coming when I run react-native run-android

Can you run react-native info and edit your issue to include these results under the Environment section?

If you believe this information is irrelevant to the reported issue, you may write [skip envinfo] under Environment to let us know.

Suddenly having this issue since 10.30am. It still work fine at 9.30am. No code changes, and any library upgrade.

Same error. My Project was working fine yesterday. :/

Having the same issue. It was working fine till now. No idea why this issue is coming when I run react-native run-android

yes i got this error when i run react-native run-android
now can't run app :-(

Same here, still work yesterday

Environment:
OS: macOS High Sierra 10.13.6
Node: 10.9.0
Yarn: 1.7.0
npm: 6.2.0
Watchman: 4.7.0
Xcode: Xcode 10.0 Build version 10A255
Android Studio: 3.1 AI-173.4907809

Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: ^0.52.3 => 0.52.3

Suddenly having this issue since 10.30am. It still work fine at 9.30am. No code changes, and any library upgrade.

same here..
issue with these 2 files

screen shot 2018-10-24 at 11 42 30 am

This error is reported here - https://developers.facebook.com/support/bugs/260814197942050/?disable_redirect=0. Not sure how we can help over here. When you submit a bug report please include your RN version.

The problem is that react-native-fbsdk repo doesn't accept issues 馃槩

@TakayukiCho I just updated my answer. Please refer to FB bug issue.

Got a work around. changednode_modules/react-native-fbsdk/android/build.gradle from compile 'com.facebook.android:facebook-android-sdk:4.38.0' to compile 'com.facebook.android:facebook-android-sdk:4.37.0'. Atleast its working now.

i just updated two files and issue solved :
screen shot 2018-10-24 at 11 54 16 am
screen shot 2018-10-24 at 11 55 53 am
go to Utility file and add null below last refreshtime 72 line and
go to FBGraphRequestModule file and add null below 163 line .

This is temporary solution .

I had the same issue today as well, upgrading react-native-fbsdk to 0.8.0 seems to fix it

@ahmedkotb Its working

Please discuss it in the corresponding issue not here.

Was this page helpful?
0 / 5 - 0 ratings