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 910 forks source link

Android: ERROR: Failed to resolve: androidsdk.modules:shield:unspecified #701

Open evelant opened 4 years ago

evelant commented 4 years ago

🐛 Bug Report

Build with react-native-fbsdk 1.1.2 fails with

ERROR: Failed to resolve: androidsdk.modules:shield:unspecified
Affected Modules: react-native-fbsdk

Build was fine, I made no changes, then I did a ./gradlew clean, reinstalled node_modules, and tried to rebuild the project. Perhaps a bad artifact got pushed for a dependency somewhere causing this sudden build failure?

To Reproduce

Build project with react-native-fbsdk 1.1.2

Expected Behavior

Build completes

Environment

System:
    OS: macOS 10.15.1
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 17.83 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.10.0 - ~/.nvm/versions/node/v12.10.0/bin/node
    Yarn: 1.19.2 - ~/.yarn/bin/yarn
    npm: 6.10.3 - ~/.nvm/versions/node/v12.10.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.6010548
    Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
  npmPackages:
    @react-native-community/cli: ^3.0.4 => 3.0.4
    react: 16.9.0 => 16.9.0
    react-native: ^0.61.5 => 0.61.5
ArekChr commented 4 years ago

the same in 1.0.0, 1.0.1, 1.0.2, 1.0.3 .....

lucidtheory commented 4 years ago

https://github.com/facebook/facebook-android-sdk/issues/673

Same on the main Android SDK appaently

dawee commented 4 years ago

As @lucidtheory mentionned it's a bug with fbsdk@5.15.2. You can go around this by fixing its version in your android/build.gradle file. At the same place as all the other variables in the begining, you can put:

facebookSdkVersion = "5.15.1"

addingama commented 4 years ago

Tried @dawee solution but still not working

lucidtheory commented 4 years ago

Make sure the spelling is exactly facebookSdkVersion capitalization matching as well

danhernandez commented 4 years ago

I tried @dawee's solution too, but it's not working either in my android/build.gradle file.

buildscript {
    ext {
        ... other dependencies
        facebookSdkVersion = "5.15.1"
    }

Is this the correct place to add it in?

thanks

danhernandez commented 4 years ago

i solved my issue by forcing the version in my app/build.gradle.

I changed:

implementation 'com.facebook.android:facebook-android-sdk:[5,6)'

to

implementation 'com.facebook.android:facebook-android-sdk:[5,5.11.1)'

as a temporary workaround, if it helps anyone else.

Jheysoon commented 4 years ago

solved this issue by editing the node_modules/react-native-fbsdk/android/build.gradle

from:

def FACEBOOK_SDK_VERSION = safeExtGet('facebookSdkVersion', '[5.0,6.0[')

to def FACEBOOK_SDK_VERSION = safeExtGet('facebookSdkVersion', '[5,5.11.1)')

krunalsshah commented 4 years ago

We can close the issue, the version with the fix is published here https://mvnrepository.com/artifact/com.facebook.android/facebook-core/5.15.3 Issue closed https://github.com/facebook/facebook-android-sdk/issues/673