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.
https://developers.facebook.com/docs/react-native
Other
2.99k stars 908 forks source link

Latest release 5.11.1 breaks app builds #676

Open andrewzey opened 4 years ago

andrewzey commented 4 years ago

You can workaround the problem by adding facebookSdkVersion=5.11.0 to your android/gradle.properties to use the old version.

Version 5.11.1 is broken. This is what happens when you run react-native run-android:


error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.facebook.android:facebook-core:5.11.1.
     Searched in the following locations:
       - file:/Users/andrew/.m2/repository/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.pom
       - file:/Users/andrew/.m2/repository/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.jar
       - file:/Users/andrew/repos/rp/RP-Diet/node_modules/react-native/android/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.pom
       - file:/Users/andrew/repos/rp/RP-Diet/node_modules/react-native/android/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.jar
       - file:/Users/andrew/repos/rp/RP-Diet/node_modules/jsc-android/dist/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.pom
       - file:/Users/andrew/repos/rp/RP-Diet/node_modules/jsc-android/dist/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.jar
       - https://dl.google.com/dl/android/maven2/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.pom
       - https://dl.google.com/dl/android/maven2/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.jar
       - https://jcenter.bintray.com/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.pom
       - https://jcenter.bintray.com/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.jar
       - https://jitpack.io/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.pom
       - https://jitpack.io/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.jar
     Required by:
         project :app > project :react-native-fbsdk
   > Could not find com.facebook.android:facebook-core:5.11.1.
     Searched in the following locations:
       - file:/Users/andrew/.m2/repository/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.pom
       - file:/Users/andrew/.m2/repository/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.jar
       - file:/Users/andrew/repos/rp/RP-Diet/node_modules/react-native/android/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.pom
       - file:/Users/andrew/repos/rp/RP-Diet/node_modules/react-native/android/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.jar
       - file:/Users/andrew/repos/rp/RP-Diet/node_modules/jsc-android/dist/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.pom
       - file:/Users/andrew/repos/rp/RP-Diet/node_modules/jsc-android/dist/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.jar
       - https://dl.google.com/dl/android/maven2/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.pom
       - https://dl.google.com/dl/android/maven2/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.jar
       - https://jcenter.bintray.com/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.pom
       - https://jcenter.bintray.com/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.jar
       - https://jitpack.io/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.pom
       - https://jitpack.io/com/facebook/android/facebook-core/5.11.1/facebook-core-5.11.1.jar
     Required by:
         project :app > project :react-native-fbsdk > com.facebook.android:facebook-login:5.11.1
         project :app > project :react-native-fbsdk > com.facebook.android:facebook-share:5.11.1
         project :app > project :react-native-fbsdk > com.facebook.android:facebook-login:5.11.1 > com.facebook.android:facebook-common:5.11.1

* 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 14s

    at checkExecSyncError (child_process.js:629:11)
    at execFileSync (child_process.js:647:13)
    at runOnAllDevices (/Users/andrew/repos/rp/RP-Diet/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:75:39)
    at buildAndRun (/Users/andrew/repos/rp/RP-Diet/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:169:41)
    at then.result (/Users/andrew/repos/rp/RP-Diet/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:135:12)
    at process._tickCallback (internal/process/next_tick.js:68:7)
error Command failed with exit code 1.
saxs4x commented 4 years ago

Not working for me

Ditway commented 4 years ago

it's working for me! thank

hatyaiapp commented 4 years ago

Not working for me too.

jile10 commented 4 years ago

working. Thank you

duytq94 commented 4 years ago

Temp solution works, notice clean the project before rebuilding it.

haulv100 commented 4 years ago

working for me. thank you

shiroze commented 4 years ago

Add another implementation to your App/build.gradle

implementation "com.facebook.android:facebook-android-sdk:5.11.0"

Hope this works

vfa-namth commented 4 years ago

Add another implementation to your App/build.gradle

implementation "com.facebook.android:facebook-android-sdk:5.11.0"

Hope this works

I tried but didn't work with me, thanks!

shiroze commented 4 years ago

Add another implementation to your App/build.gradle

implementation "com.facebook.android:facebook-android-sdk:5.11.0"

Hope this works

I tried but didn't work with me, thanks!

can you provide react, react-native, react-native-fbsdk version ?

vfa-namth commented 4 years ago

Add another implementation to your App/build.gradle

implementation "com.facebook.android:facebook-android-sdk:5.11.0"

Hope this works

I tried but didn't work with me, thanks!

can you provide react, react-native, react-native-fbsdk version ? "react": "16.8.6", "react-native": "0.60.4", "react-native-fbsdk": "^1.1.1",

Kailash23 commented 4 years ago

Workaround: Making it easier to find @andrewzey To make it work, you have to add facebookSdkVersion=5.11.0 to your android/gradle.properties to use the old version.

andrewzey commented 4 years ago

@Kailash23 Thanks. I'll update my post to put this info at the top to make it easier for folks to see.

jakks-team commented 4 years ago

@andrewzey Also, to be easier, maybe can share where in the code to actually put that, some people might not realize or know where to put it.

in your react-native project, android/build.gradle find :

buildscript { ext { // there should be a lot of things here, like buildToolVersion, minSdkVersion, etc. // Add 1 more line below facebookSdkVersion = "5.11.0" } }

krunalsshah commented 4 years ago

UPDATE : v5.11.2 was just released. You can use implementation 'com.facebook.android:facebook-core:5.11.2' to force the gradle to fetch the latest v5.11.2 https://github.com/facebook/facebook-android-sdk/issues/637#issuecomment-557442146

mikehardy commented 4 years ago

FWIW cocoapods still has 5.11.1 (verified with an updated repo) but it may just be release policy doesn't require lock-step releases between android & iOS

- FBSDKCoreKit 5.8.0 -> 5.8.0 (latest version 5.11.1)