Could not find androidsdk.modules

In my case i just replaced my dependency with

implementation 'com.facebook.android:facebook-android-sdk:5.15.3'

and it worked.


We can config 3 thing about the facebook SDK to a react native Android app:

  1. Version lib in package.json.
  2. Dependency on android/app/build.gradle
  3. Facebook sdk version on android/build.gradle.

This errors is probably a bug: https://github.com/facebook/react-native-fbsdk/issues/701

For me work this config:

  1. "react-native-fbsdk": "1.1.2", in package.json
  2. implementation 'com.facebook.android:facebook-android-sdk:[5,5.11.1)' on android/app/build.gradle.
  3. facebookSdkVersion = '5.15.3' in android/build.gradle

I should have mentioned that this solution works for React Native. Rob's solution is best for native Android.


I just now had the same problem and here's what worked for me. Add facebookSdkVersion = "5.15.3" to

android
|--build.gradle
buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 18
        compileSdkVersion = 28
        targetSdkVersion = 28
        ...

        // This is a temporary fix for react-native-fbsdk v1.1.2
        facebookSdkVersion = "5.15.3"
    }
}

References:

  • https://github.com/facebook/facebook-android-sdk/issues/673
  • https://github.com/facebook/react-native-fbsdk/issues/701

This fixed it for me. Only started happening today.

implementation 'com.facebook.android:facebook-android-sdk:5.15.3'